From 86c7e1a947bec94217f81e2007018f20c7e17a9b Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Fri, 14 Apr 2006 16:42:14 +0000 Subject: [PATCH] Fix some stop/pause/boost stuff git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9662 a1c6a512-1295-4272-9138-f99709370657 --- apps/pcmbuf.c | 2 +- apps/playback.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index a252f5c651..ab41df0fb8 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -380,7 +380,7 @@ void pcmbuf_pause(bool pause) { pcm_play_pause(!pause); if (!pause) pcm_mute(false); - pcmbuf_boost(!pause); + pcmbuf_boost(!pause && pcm_is_playing()); } /* Force playback. */ diff --git a/apps/playback.c b/apps/playback.c index bc5785f45d..90b04aec1a 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1669,12 +1669,8 @@ static void audio_play_start(size_t offset) #endif /* Wait for any previously playing audio to flush */ - if (audio_codec_loaded) - { - playing = false; - queue_empty(&codec_queue); + while (audio_codec_loaded) stop_codec_flush(); - } track_changed = true; playlist_end = false; @@ -1924,6 +1920,7 @@ static void initiate_dir_change(long direction) if(!playlist_next_dir(direction)) return; + ci.reload_codec = true; queue_post(&audio_queue, Q_AUDIO_PLAY, 0); } @@ -2081,6 +2078,7 @@ void codec_thread(void) swap_codec(); sleep(1); } + queue_clear(&codec_queue); logf("USB: Audio codec"); usb_acknowledge(SYS_USB_CONNECTED_ACK); usb_wait_for_disconnect(&codec_queue); @@ -2089,7 +2087,7 @@ void codec_thread(void) } if (audio_codec_loaded) - if (ci.stop_codec && pcm_is_paused()) + if (!playing && ci.stop_codec) pcmbuf_play_stop(); audio_codec_loaded = false;