From ec2d2c47a01e6f244ebba0b945565e0611d71efe Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 31 Jul 2007 10:00:50 +0000 Subject: Hopefully fix the problems with voice not cancelling its CPU boost. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14094 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'apps') diff --git a/apps/playback.c b/apps/playback.c index 6c9c0065cd..0533ddcf4c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -914,10 +914,6 @@ static void swap_codec(void) } while (my_codec == current_codec); /* Wait for other codec to unlock */ - /* FIXME: We need some sort of timed boost cancellation here or the CPU - doesn't unboost during playback when the voice codec goes back to - waiting - recall that mutex_lock calls block_thread which is an - indefinite wait that doesn't cancel the thread's CPU boost */ mutex_lock(&mutex_codecthread); /* Take control */ @@ -1112,6 +1108,10 @@ static bool voice_on_voice_stop(bool aborting, size_t *realsize) voice_remaining = 0; voicebuf = NULL; + /* Cancel any automatic boost if no more clips requested. */ + if (!playing || !voice_thread_start) + sleep(0); + /* Force the codec to think it's changing tracks */ ci_voice.new_track = 1; @@ -1142,14 +1142,7 @@ static void* voice_request_buffer_callback(size_t *realsize, size_t reqsize) } else { - /* We must use queue_wait_w_tmo() because queue_wait() doesn't - unboost the CPU */ - /* FIXME: when long timeouts work correctly max out the the timeout - (we'll still need the timeout guard here) or an infinite timeout - can unboost, use that */ - do - queue_wait_w_tmo(&voice_queue, &ev, HZ*5); - while (ev.id == SYS_TIMEOUT); /* Fake infinite wait */ + queue_wait(&voice_queue, &ev); } switch (ev.id) { -- cgit v1.2.3