diff options
-rw-r--r-- | apps/codec_thread.c | 6 | ||||
-rw-r--r-- | apps/codec_thread.h | 1 | ||||
-rw-r--r-- | apps/pcmbuf.c | 15 |
3 files changed, 4 insertions, 18 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c index a7bff746d8..945f0b0605 100644 --- a/apps/codec_thread.c +++ b/apps/codec_thread.c | |||
@@ -636,12 +636,6 @@ void codec_thread_resume(void) | |||
636 | thread_thaw(codec_thread_id); | 636 | thread_thaw(codec_thread_id); |
637 | } | 637 | } |
638 | 638 | ||
639 | /* Is the current thread the codec thread? */ | ||
640 | bool is_codec_thread(void) | ||
641 | { | ||
642 | return thread_self() == codec_thread_id; | ||
643 | } | ||
644 | |||
645 | #ifdef HAVE_PRIORITY_SCHEDULING | 639 | #ifdef HAVE_PRIORITY_SCHEDULING |
646 | /* Obtain codec thread's current priority */ | 640 | /* Obtain codec thread's current priority */ |
647 | int codec_thread_get_priority(void) | 641 | int codec_thread_get_priority(void) |
diff --git a/apps/codec_thread.h b/apps/codec_thread.h index acd7e556e2..14551dcf48 100644 --- a/apps/codec_thread.h +++ b/apps/codec_thread.h | |||
@@ -36,7 +36,6 @@ void codec_thread_do_callback(void (*fn)(void), | |||
36 | void codec_init_codec_api(void); | 36 | void codec_init_codec_api(void); |
37 | void make_codec_thread(void); | 37 | void make_codec_thread(void); |
38 | void codec_thread_resume(void); | 38 | void codec_thread_resume(void); |
39 | bool is_codec_thread(void); | ||
40 | #ifdef HAVE_PRIORITY_SCHEDULING | 39 | #ifdef HAVE_PRIORITY_SCHEDULING |
41 | int codec_thread_get_priority(void); | 40 | int codec_thread_get_priority(void); |
42 | int codec_thread_set_priority(int priority); | 41 | int codec_thread_set_priority(int priority); |
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 946eb16021..2e8bc3f47c 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c | |||
@@ -332,17 +332,10 @@ static bool prepare_insert(size_t length) | |||
332 | /* Maintain the buffer level above the watermark */ | 332 | /* Maintain the buffer level above the watermark */ |
333 | if (playing) | 333 | if (playing) |
334 | { | 334 | { |
335 | /* Only codec thread initiates boost - voice boosts the cpu when playing | 335 | /* boost cpu if necessary */ |
336 | a clip */ | 336 | if (pcmbuf_unplayed_bytes < pcmbuf_watermark) |
337 | #ifndef SIMULATOR | 337 | trigger_cpu_boost(); |
338 | if (is_codec_thread()) | 338 | boost_codec_thread(pcmbuf_unplayed_bytes*10/pcmbuf_size); |
339 | #endif /* SIMULATOR */ | ||
340 | { | ||
341 | /* boost cpu if necessary */ | ||
342 | if (pcmbuf_unplayed_bytes < pcmbuf_watermark) | ||
343 | trigger_cpu_boost(); | ||
344 | boost_codec_thread(pcmbuf_unplayed_bytes*10/pcmbuf_size); | ||
345 | } | ||
346 | 339 | ||
347 | #ifdef HAVE_CROSSFADE | 340 | #ifdef HAVE_CROSSFADE |
348 | /* Disable crossfade if < .5s of audio */ | 341 | /* Disable crossfade if < .5s of audio */ |