When starting playback, prevent the codec from starting to decode too early, which would cause rebuffering (slowing things down) and incorrect playlist index. Hopefully fixes a bunch of playback-related bugs, such as FS#8520, FS#8525, FS#8555 and possibly FS#8511.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16392 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Magnus Holmgren 2008-02-23 17:46:33 +00:00
parent 620da596fb
commit 68f9e6bfee

View file

@ -1659,6 +1659,8 @@ static bool audio_load_track(int offset, bool start_play)
}
last_peek_offset++;
tracks[track_widx].taginfo_ready = false;
peek_again:
logf("Buffering track:%d/%d", track_widx, track_ridx);
/* Get track name from current playlist read position. */
@ -1708,7 +1710,6 @@ static bool audio_load_track(int offset, bool start_play)
tracks[track_widx].id3_hid =
bufalloc(&id3, sizeof(struct mp3entry), TYPE_ID3);
tracks[track_widx].taginfo_ready = (tracks[track_widx].id3_hid >= 0);
if (tracks[track_widx].id3_hid < 0)
{
@ -1733,7 +1734,6 @@ static bool audio_load_track(int offset, bool start_play)
/* Skip invalid entry from playlist. */
playlist_skip_entry(NULL, last_peek_offset);
tracks[track_widx].taginfo_ready = false;
close(fd);
goto peek_again;
}
@ -1791,7 +1791,6 @@ static bool audio_load_track(int offset, bool start_play)
gui_syncsplash(HZ*2, msgbuf);
/* Skip invalid entry from playlist. */
playlist_skip_entry(NULL, last_peek_offset);
tracks[track_widx].taginfo_ready = false;
goto peek_again;
}
@ -1852,6 +1851,9 @@ static bool audio_load_track(int offset, bool start_play)
if (tracks[track_widx].audio_hid < 0)
return false;
/* All required data is now available for the codec. */
tracks[track_widx].taginfo_ready = true;
if (start_play)
{
ci.curpos=file_offset;