Added MP3 buffer margin setting

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2939 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-12-05 13:09:51 +00:00
parent f4233e482d
commit b8ff5f8971
7 changed files with 34 additions and 5 deletions

View file

@ -470,6 +470,7 @@ static bool filling; /* We are filling the buffer with data from disk */
static bool dma_underrun; /* True when the DMA has stopped because of
slow disk reading (read error, shaking) */
static int low_watermark; /* Dynamic low watermark level */
static int low_watermark_margin; /* Extra time in seconds for watermark */
static int lowest_watermark_level; /* Debug value to observe the buffer
usage */
#ifdef HAVE_MAS3587F
@ -492,7 +493,8 @@ static void recalculate_watermark(int bitrate)
{
if(ata_spinup_time)
{
low_watermark = ata_spinup_time * 3 / HZ * bitrate*1000 / 8;
low_watermark = (low_watermark_margin + ata_spinup_time * 3 / HZ) *
bitrate*1000 / 8;
}
else
{
@ -500,6 +502,11 @@ static void recalculate_watermark(int bitrate)
}
}
void mpeg_set_buffer_margin(int seconds)
{
low_watermark_margin = seconds;
}
void mpeg_get_debugdata(struct mpeg_debug *dbgdata)
{
dbgdata->mp3buflen = mp3buflen;