diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-10-25 22:52:40 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-10-25 22:52:40 +0000 |
commit | 14da611cd32d084813bb0d2e2318b81c3ea2953a (patch) | |
tree | ad42fbf5b3778ea80430f9bf51bb270b64eafa10 | |
parent | c9389e4ee86b5626b36fdf15220aa793fd651030 (diff) | |
download | rockbox-14da611cd32d084813bb0d2e2318b81c3ea2953a.tar.gz rockbox-14da611cd32d084813bb0d2e2318b81c3ea2953a.zip |
Check the audio queue for new messages while filling the buffer with tracks. This cuts down the long wait for a skip (or any other action) while adding a large number of tracks to the buffer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15309 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/playback.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/playback.c b/apps/playback.c index 0cda680c0b..1a51bd2c41 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -2616,6 +2616,13 @@ static void audio_fill_file_buffer(bool start_play, size_t offset) | |||
2616 | start_play = false; | 2616 | start_play = false; |
2617 | offset = 0; | 2617 | offset = 0; |
2618 | sleep(1); | 2618 | sleep(1); |
2619 | if (!queue_empty(&audio_queue)) { | ||
2620 | /* There's a message in the queue. break the loop to treat it, | ||
2621 | and go back to filling after that. */ | ||
2622 | LOGFQUEUE("buffering > audio Q_AUDIO_FILL_BUFFER"); | ||
2623 | queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); | ||
2624 | break; | ||
2625 | } | ||
2619 | } while (continue_buffering); | 2626 | } while (continue_buffering); |
2620 | 2627 | ||
2621 | if (!had_next_track && audio_next_track()) | 2628 | if (!had_next_track && audio_next_track()) |