Rockbox mail archive
Subject: RE: search a string
From: Linus Nielsen Feltzing (linus_at_haxx.se)
On Fri, 6 Sep 2002 14:20:54 -0400, John Wood wrote:
> > The MP3 buffer is a ring buffer that wraps at the end. Thus, the
> > unused memory can be anywhere in that buffer, depending on where
> > data was loaded the last time.
> What tells it where the buffer starts and ends? And how often can
> you tell it?
It's a ring buffer. Basically, two pointers tell where it starts and
ends. The DMA handler reads data using the mp3buf_read index, and
advances it when the data has been played. The disk reader writes
data using the mp3buf_write index. The buffer is empty when
mp3buf_read and mp3buf_write are equal.
The size of the loaded but unplayed data is thus
mp3buf_write-mp3buf_read. It's all in mpeg.c if you want to dive
deeper into it.
Linus Nielsen Feltzing, linus_at_haxx.se on 2002-09-06
Page was last modified "Jan 10 2012" The Rockbox Crew