summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 2ac54e7d74..3c1dd37d3f 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -2569,6 +2569,7 @@ static void low_buffer_callback(void)
2569 2569
2570static void audio_fill_file_buffer(bool start_play, size_t offset) 2570static void audio_fill_file_buffer(bool start_play, size_t offset)
2571{ 2571{
2572 struct queue_event ev;
2572 bool had_next_track = audio_next_track() != NULL; 2573 bool had_next_track = audio_next_track() != NULL;
2573 bool continue_buffering; 2574 bool continue_buffering;
2574 2575
@@ -2591,9 +2592,14 @@ static void audio_fill_file_buffer(bool start_play, size_t offset)
2591 start_play = false; 2592 start_play = false;
2592 offset = 0; 2593 offset = 0;
2593 sleep(1); 2594 sleep(1);
2594 if (!queue_empty(&audio_queue)) { 2595 if (queue_peek(&audio_queue, &ev)) {
2595 /* There's a message in the queue. break the loop to treat it, 2596 if (ev.id != Q_AUDIO_FILL_BUFFER)
2596 and go back to filling after that. */ 2597 {
2598 /* There's a message in the queue. break the loop to treat it,
2599 and go back to filling after that. */
2600 LOGFQUEUE("buffering > audio Q_AUDIO_FILL_BUFFER");
2601 queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0);
2602 }
2597 break; 2603 break;
2598 } 2604 }
2599 } while (continue_buffering); 2605 } while (continue_buffering);