diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-04-14 12:53:29 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-04-14 12:53:29 +0000 |
commit | fbe74d1df619fbb3620d55c5743e6c0b412cf137 (patch) | |
tree | a58d23456f96fd0c1026227d4889d4b3d017a871 | |
parent | 74ccea9fb15c2551a4217c4e1c6e59109e9fa9d2 (diff) |
Fix one cause of buffer-offness, but I'm pretty sure this is not the cause of problems that people are having as the debug code I put in detects and corrects it. Make taginfo instead of stupid filename appear on manual track skip, off buffer (stupid bug).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9658 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/playback.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c index 01f165c863..40f88f68d4 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -645,14 +645,16 @@ size_t buffer_count_tracks(int from_track, int to_track) { from_track++; - while (from_track < to_track || need_wrap) + while (1) { - amount += tracks[from_track].codecsize + tracks[from_track].filesize; if (++from_track >= MAX_TRACK) { from_track -= MAX_TRACK; need_wrap = false; } + if (from_track < to_track || need_wrap) + break; + amount += tracks[from_track].codecsize + tracks[from_track].filesize; } return amount; } @@ -818,7 +820,10 @@ static void audio_check_new_track(bool require_codec) /* If it is not safe to even skip this many track entries */ if (new_track >= track_count || new_track <= track_count - MAX_TRACK) + { + cur_ti->taginfo_ready = false; audio_rebuffer(); + } /* If the target track is clearly not in memory */ else if (cur_ti->filesize == 0 || !cur_ti->taginfo_ready) audio_rebuffer(); @@ -2190,7 +2195,7 @@ struct mp3entry* audio_current_track(void) else if (cur_idx < 0) cur_idx += MAX_TRACK; - if (have_tracks() && tracks[cur_idx].taginfo_ready) + if (tracks[cur_idx].taginfo_ready) return &tracks[cur_idx].id3; memset(&temp_id3, 0, sizeof(struct mp3entry)); |