From 34193e5cf23e7d739c2ccda0ed82e77492578cef Mon Sep 17 00:00:00 2001 From: Steve Bavin Date: Thu, 26 Oct 2006 12:13:28 +0000 Subject: Don't clear previous track details during playback so the progress bar works properly at track transition git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11350 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index 7b952e6919..a3e12c3d08 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -686,8 +686,8 @@ void audio_preinit(void) track_buffer_callback = NULL; track_unbuffer_callback = NULL; track_changed_callback = NULL; - /* Just to prevent CUR_TI from being anything random. */ - track_ridx = 0; + track_ridx = 0; /* Just to prevent CUR_TI from being anything random. */ + prev_ti = &tracks[MAX_TRACK-1]; /* And prevent prev_ti being random too */ mutex_init(&mutex_codecthread); @@ -1198,6 +1198,7 @@ static void* codec_get_memory_callback(size_t *size) static void codec_pcmbuf_position_callback(size_t size) ICODE_ATTR; static void codec_pcmbuf_position_callback(size_t size) { + /* This is called from an ISR, so be quick */ unsigned int time = size * 1000 / 4 / NATIVE_FREQUENCY + prev_ti->id3.elapsed; @@ -2656,7 +2657,7 @@ static void audio_fill_file_buffer( bool had_next_track = audio_next_track() != NULL; bool continue_buffering; - if (!audio_initialize_buffer_fill(!start_play)) + if (!audio_initialize_buffer_fill(start_play)) return ; /* If we have a partially buffered track, continue loading, -- cgit v1.2.3