From 6ae46065b40691d5571252aeeb2ec5475e2f5e4c Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 29 Nov 2006 17:52:30 +0000 Subject: Add support for compiling encoders without adjustable CPU frequency and/or IRAM. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11625 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/aiff_enc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'apps/codecs/aiff_enc.c') diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c index ba7e36e99e..c1c2a9ec48 100644 --- a/apps/codecs/aiff_enc.c +++ b/apps/codecs/aiff_enc.c @@ -298,7 +298,9 @@ static bool init_encoder(void) ci->enc_set_parameters == NULL || ci->enc_get_chunk == NULL || ci->enc_finish_chunk == NULL || +#ifdef HAVE_ADJUSTABLE_CPU_FREQ ci->enc_pcm_buf_near_empty == NULL || +#endif ci->enc_get_pcm_data == NULL ) return false; @@ -325,7 +327,9 @@ static bool init_encoder(void) /* main codec entry point */ enum codec_status codec_main(void) { +#ifdef HAVE_ADJUSTABLE_CPU_FREQ bool cpu_boosted; +#endif if (!init_encoder()) { @@ -336,8 +340,10 @@ enum codec_status codec_main(void) /* main application waits for this flag during encoder loading */ ci->enc_codec_loaded = 1; +#ifdef HAVE_ADJUSTABLE_CPU_FREQ ci->cpu_boost(true); cpu_boosted = true; +#endif /* main encoding loop */ while(!ci->stop_codec) @@ -351,12 +357,13 @@ enum codec_status codec_main(void) if (ci->stop_codec) break; +#ifdef HAVE_ADJUSTABLE_CPU_FREQ if (!cpu_boosted && ci->enc_pcm_buf_near_empty() == 0) { ci->cpu_boost(true); cpu_boosted = true; } - +#endif chunk = ci->enc_get_chunk(); chunk->enc_size = enc_size; chunk->num_pcm = PCM_SAMP_PER_CHUNK; @@ -368,17 +375,20 @@ enum codec_status codec_main(void) ci->yield(); } +#ifdef HAVE_ADJUSTABLE_CPU_FREQ if (cpu_boosted && ci->enc_pcm_buf_near_empty() != 0) { ci->cpu_boost(false); cpu_boosted = false; } - +#endif ci->yield(); } +#ifdef HAVE_ADJUSTABLE_CPU_FREQ if (cpu_boosted) /* set initial boost state */ ci->cpu_boost(false); +#endif /* reset parameters to initial state */ ci->enc_set_parameters(NULL); -- cgit v1.2.3