diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2008-02-23 17:46:33 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2008-02-23 17:46:33 +0000 |
commit | 68f9e6bfee2d7da5699a9d7e910c12cd1b52232f (patch) | |
tree | 4073371386d5480c9b633b45b669e775557a6b10 /apps | |
parent | 620da596fbfba14ea2e296220ec7313fcccbadb0 (diff) | |
download | rockbox-68f9e6bfee2d7da5699a9d7e910c12cd1b52232f.tar.gz rockbox-68f9e6bfee2d7da5699a9d7e910c12cd1b52232f.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playback.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c index 87773f89ef..cca5b73247 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -1659,6 +1659,8 @@ static bool audio_load_track(int offset, bool start_play) | |||
1659 | } | 1659 | } |
1660 | 1660 | ||
1661 | last_peek_offset++; | 1661 | last_peek_offset++; |
1662 | tracks[track_widx].taginfo_ready = false; | ||
1663 | |||
1662 | peek_again: | 1664 | peek_again: |
1663 | logf("Buffering track:%d/%d", track_widx, track_ridx); | 1665 | logf("Buffering track:%d/%d", track_widx, track_ridx); |
1664 | /* Get track name from current playlist read position. */ | 1666 | /* Get track name from current playlist read position. */ |
@@ -1708,7 +1710,6 @@ static bool audio_load_track(int offset, bool start_play) | |||
1708 | 1710 | ||
1709 | tracks[track_widx].id3_hid = | 1711 | tracks[track_widx].id3_hid = |
1710 | bufalloc(&id3, sizeof(struct mp3entry), TYPE_ID3); | 1712 | bufalloc(&id3, sizeof(struct mp3entry), TYPE_ID3); |
1711 | tracks[track_widx].taginfo_ready = (tracks[track_widx].id3_hid >= 0); | ||
1712 | 1713 | ||
1713 | if (tracks[track_widx].id3_hid < 0) | 1714 | if (tracks[track_widx].id3_hid < 0) |
1714 | { | 1715 | { |
@@ -1733,7 +1734,6 @@ static bool audio_load_track(int offset, bool start_play) | |||
1733 | 1734 | ||
1734 | /* Skip invalid entry from playlist. */ | 1735 | /* Skip invalid entry from playlist. */ |
1735 | playlist_skip_entry(NULL, last_peek_offset); | 1736 | playlist_skip_entry(NULL, last_peek_offset); |
1736 | tracks[track_widx].taginfo_ready = false; | ||
1737 | close(fd); | 1737 | close(fd); |
1738 | goto peek_again; | 1738 | goto peek_again; |
1739 | } | 1739 | } |
@@ -1791,7 +1791,6 @@ static bool audio_load_track(int offset, bool start_play) | |||
1791 | gui_syncsplash(HZ*2, msgbuf); | 1791 | gui_syncsplash(HZ*2, msgbuf); |
1792 | /* Skip invalid entry from playlist. */ | 1792 | /* Skip invalid entry from playlist. */ |
1793 | playlist_skip_entry(NULL, last_peek_offset); | 1793 | playlist_skip_entry(NULL, last_peek_offset); |
1794 | tracks[track_widx].taginfo_ready = false; | ||
1795 | goto peek_again; | 1794 | goto peek_again; |
1796 | } | 1795 | } |
1797 | 1796 | ||
@@ -1852,6 +1851,9 @@ static bool audio_load_track(int offset, bool start_play) | |||
1852 | if (tracks[track_widx].audio_hid < 0) | 1851 | if (tracks[track_widx].audio_hid < 0) |
1853 | return false; | 1852 | return false; |
1854 | 1853 | ||
1854 | /* All required data is now available for the codec. */ | ||
1855 | tracks[track_widx].taginfo_ready = true; | ||
1856 | |||
1855 | if (start_play) | 1857 | if (start_play) |
1856 | { | 1858 | { |
1857 | ci.curpos=file_offset; | 1859 | ci.curpos=file_offset; |