diff options
| author | Brandon Low <lostlogic@rockbox.org> | 2006-04-19 00:23:08 +0000 |
|---|---|---|
| committer | Brandon Low <lostlogic@rockbox.org> | 2006-04-19 00:23:08 +0000 |
| commit | 4b36096b930bef45ba14d09bf0e59ac9c87c3e81 (patch) | |
| tree | 9b7a933e714e3d7550df795214caeedb39f58276 | |
| parent | 56d6f3ecfcfe5284906c96234a551931d39279cd (diff) | |
| download | rockbox-4b36096b930bef45ba14d09bf0e59ac9c87c3e81.zip rockbox-4b36096b930bef45ba14d09bf0e59ac9c87c3e81.tar.gz rockbox-4b36096b930bef45ba14d09bf0e59ac9c87c3e81.tar.bz2 rockbox-4b36096b930bef45ba14d09bf0e59ac9c87c3e81.tar.xz | |
Have the codec thread stop the pcm if we need to spin up the disk
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9727 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playback.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/playback.c b/apps/playback.c index e6a6e06..18a215c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -122,6 +122,7 @@ enum { Q_AUDIO_POSTINIT, Q_AUDIO_FILL_BUFFER, + Q_CODEC_REQUEST_PENDING, Q_CODEC_REQUEST_COMPLETE, Q_CODEC_REQUEST_FAILED, @@ -760,6 +761,9 @@ static void audio_update_trackinfo(void) static void audio_rebuffer(void) { logf("Forcing rebuffer"); + /* Notify the codec that this will take a while */ + if (!filling) + queue_post(&codec_callback_queue, Q_CODEC_REQUEST_PENDING, 0); /* Stop in progress fill, and clear open file descriptor */ close(current_fd); current_fd = -1; @@ -1871,7 +1875,13 @@ static bool load_next_track(void) { cpu_boost(true); queue_post(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, 0); - queue_wait(&codec_callback_queue, &ev); + while (1) { + queue_wait(&codec_callback_queue, &ev); + if (ev.id == Q_CODEC_REQUEST_PENDING) + pcmbuf_play_stop(); + else + break; + } cpu_boost(false); switch (ev.id) { |