mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-17 17:12:39 -05:00
Last fix was wrong, I did the math this time, should fix more buffering edges
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11315 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4a4c67f660
commit
500a761cb0
1 changed files with 8 additions and 8 deletions
|
|
@ -2154,30 +2154,30 @@ static bool audio_read_file(size_t minimum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tracks[track_widx].available += rc;
|
|
||||||
tracks[track_widx].filerem -= rc;
|
|
||||||
|
|
||||||
/* How much of the playing track did we overwrite */
|
/* How much of the playing track did we overwrite */
|
||||||
if (buf_widx == CUR_TI->buf_idx)
|
if (buf_widx == CUR_TI->buf_idx)
|
||||||
{
|
{
|
||||||
/* Special handling; zero or full overlap? */
|
/* Special handling; zero or full overlap? */
|
||||||
if (CUR_TI->filerem)
|
if (track_widx == track_ridx && CUR_TI->available == 0)
|
||||||
overlap = rc;
|
overlap = 0;
|
||||||
else
|
else
|
||||||
overlap=0;
|
overlap = rc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
overlap = RINGBUF_ADD_CROSS(buf_widx,rc,CUR_TI->buf_idx);
|
overlap = RINGBUF_ADD_CROSS(buf_widx,rc,CUR_TI->buf_idx);
|
||||||
|
|
||||||
/* Advance buffer */
|
/* Advance buffer */
|
||||||
buf_widx = RINGBUF_ADD(buf_widx, rc);
|
buf_widx = RINGBUF_ADD(buf_widx, rc);
|
||||||
|
tracks[track_widx].available += rc;
|
||||||
|
tracks[track_widx].filerem -= rc;
|
||||||
|
|
||||||
/* If we write into the playing track, adjust it's buffer info */
|
/* If we write into the playing track, adjust it's buffer info */
|
||||||
if (overlap > 0 && CUR_TI->available != 0) {
|
if (overlap > 0)
|
||||||
|
{
|
||||||
CUR_TI->buf_idx += overlap;
|
CUR_TI->buf_idx += overlap;
|
||||||
CUR_TI->start_pos += overlap;
|
CUR_TI->start_pos += overlap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For a rebuffer, fill at least this minimum */
|
/* For a rebuffer, fill at least this minimum */
|
||||||
if (minimum > (unsigned)rc)
|
if (minimum > (unsigned)rc)
|
||||||
minimum -= rc;
|
minimum -= rc;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue