From b288dda68504fc44d16bbc0d321166d291606a62 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sun, 10 Jul 2005 08:38:16 +0000 Subject: Fixed a problem that next track info was not always available after the initial file buffering. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7091 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'apps/playback.c') diff --git a/apps/playback.c b/apps/playback.c index 82ccddfac0..fb96592511 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -860,8 +860,10 @@ bool audio_load_track(int offset, bool start_play, int peek_offset) int rc, i; int copy_n; - /* Stop buffer filling if there is no free track entries. */ - if (track_count >= MAX_TRACK) { + /* Stop buffer filling if there is no free track entries. + Don't fill up the last track entry (we wan't to store next track + metadata there). */ + if (track_count >= MAX_TRACK - 1) { fill_bytesleft = 0; return false; } @@ -1185,7 +1187,7 @@ void audio_check_buffer(void) if (audio_load_track(0, false, last_peek_offset)) { last_peek_offset++; } else if (tracks[track_widx].filerem == 0 || fill_bytesleft == 0) { - if (track_count <= 1) + if (audio_next_track() == NULL) read_next_metadata(); generate_postbuffer_events(); @@ -1193,10 +1195,8 @@ void audio_check_buffer(void) conf_bufferlimit = 0; pcm_set_boost_mode(false); - if (playing) { - ata_flush(); + if (playing) ata_sleep(); - } } } -- cgit v1.2.3