diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-05-03 21:49:59 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-05-03 21:49:59 +0000 |
commit | d7e8e3825341b6b8007d7174e4874c1c5d4542d4 (patch) | |
tree | 33c72572df0a01e67a6f55343deb203c5b9947bc /apps/playback.c | |
parent | 0658dce706b19c1fd15e29e71a8de5eb7e85bf42 (diff) |
Audio seemed never to want to stop stopping. A bad condition for plugins that want to stop audio and begin pcm playback immediately. Only do the stop if the state is playing. Properly wait for it to be done as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13317 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/playback.c b/apps/playback.c index 545076954f..b26754eb3a 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -695,12 +695,9 @@ void audio_play(long offset) void audio_stop(void) { /* Stop playback */ - LOGFQUEUE("audio > audio Q_AUDIO_STOP"); - queue_post(&audio_queue, Q_AUDIO_STOP, 0); - + LOGFQUEUE("audio >| audio Q_AUDIO_STOP"); /* Don't return until playback has actually stopped */ - while(playing || !queue_empty(&audio_queue)) - yield(); + queue_send(&audio_queue, Q_AUDIO_STOP, 0); } void audio_pause(void) @@ -3644,7 +3641,8 @@ static void audio_thread(void) case Q_AUDIO_STOP: LOGFQUEUE("audio < Q_AUDIO_STOP"); - audio_stop_playback(); + if (playing) + audio_stop_playback(); if (ev.data != 0) queue_clear(&audio_queue); break ; |