diff options
-rw-r--r-- | apps/playback.c | 7 |
1 files 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) | |||
686 | track_buffer_callback = NULL; | 686 | track_buffer_callback = NULL; |
687 | track_unbuffer_callback = NULL; | 687 | track_unbuffer_callback = NULL; |
688 | track_changed_callback = NULL; | 688 | track_changed_callback = NULL; |
689 | /* Just to prevent CUR_TI from being anything random. */ | 689 | track_ridx = 0; /* Just to prevent CUR_TI from being anything random. */ |
690 | track_ridx = 0; | 690 | prev_ti = &tracks[MAX_TRACK-1]; /* And prevent prev_ti being random too */ |
691 | 691 | ||
692 | mutex_init(&mutex_codecthread); | 692 | mutex_init(&mutex_codecthread); |
693 | 693 | ||
@@ -1198,6 +1198,7 @@ static void* codec_get_memory_callback(size_t *size) | |||
1198 | static void codec_pcmbuf_position_callback(size_t size) ICODE_ATTR; | 1198 | static void codec_pcmbuf_position_callback(size_t size) ICODE_ATTR; |
1199 | static void codec_pcmbuf_position_callback(size_t size) | 1199 | static void codec_pcmbuf_position_callback(size_t size) |
1200 | { | 1200 | { |
1201 | /* This is called from an ISR, so be quick */ | ||
1201 | unsigned int time = size * 1000 / 4 / NATIVE_FREQUENCY + | 1202 | unsigned int time = size * 1000 / 4 / NATIVE_FREQUENCY + |
1202 | prev_ti->id3.elapsed; | 1203 | prev_ti->id3.elapsed; |
1203 | 1204 | ||
@@ -2656,7 +2657,7 @@ static void audio_fill_file_buffer( | |||
2656 | bool had_next_track = audio_next_track() != NULL; | 2657 | bool had_next_track = audio_next_track() != NULL; |
2657 | bool continue_buffering; | 2658 | bool continue_buffering; |
2658 | 2659 | ||
2659 | if (!audio_initialize_buffer_fill(!start_play)) | 2660 | if (!audio_initialize_buffer_fill(start_play)) |
2660 | return ; | 2661 | return ; |
2661 | 2662 | ||
2662 | /* If we have a partially buffered track, continue loading, | 2663 | /* If we have a partially buffered track, continue loading, |