summaryrefslogtreecommitdiffstats
path: root/apps/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/aiff_enc.c13
-rw-r--r--apps/codecs/mp3_enc.c13
-rw-r--r--apps/codecs/wav_enc.c13
-rw-r--r--apps/codecs/wavpack_enc.c15
4 files changed, 9 insertions, 45 deletions
diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c
index 2d55dff755..69496f70ac 100644
--- a/apps/codecs/aiff_enc.c
+++ b/apps/codecs/aiff_enc.c
@@ -363,16 +363,10 @@ static bool init_encoder(void)
enum codec_status codec_main(void)
{
if (!init_encoder())
- {
- ci->enc_codec_loaded = -1;
return CODEC_ERROR;
- }
-
- /* main application waits for this flag during encoder loading */
- ci->enc_codec_loaded = 1;
/* main encoding loop */
- while(!ci->stop_encoder)
+ while(!ci->stop_codec)
{
uint32_t *src;
@@ -380,7 +374,7 @@ enum codec_status codec_main(void)
{
struct enc_chunk_hdr *chunk;
- if (ci->stop_encoder)
+ if (ci->stop_codec)
break;
chunk = ci->enc_get_chunk();
@@ -400,8 +394,5 @@ enum codec_status codec_main(void)
/* reset parameters to initial state */
ci->enc_set_parameters(NULL);
- /* main application waits for this flag during encoder removing */
- ci->enc_codec_loaded = 0;
-
return CODEC_OK;
} /* codec_start */
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index c66d755f08..e7893fd14a 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2588,16 +2588,10 @@ enum codec_status codec_main(void)
{
/* Generic codec initialisation */
if (!enc_init())
- {
- ci->enc_codec_loaded = -1;
return CODEC_ERROR;
- }
-
- /* main application waits for this flag during encoder loading */
- ci->enc_codec_loaded = 1;
/* main encoding loop */
- while (!ci->stop_encoder)
+ while (!ci->stop_codec)
{
char *buffer;
@@ -2605,7 +2599,7 @@ enum codec_status codec_main(void)
{
struct enc_chunk_hdr *chunk;
- if (ci->stop_encoder)
+ if (ci->stop_codec)
break;
chunk = ci->enc_get_chunk();
@@ -2630,8 +2624,5 @@ enum codec_status codec_main(void)
/* reset parameters to initial state */
ci->enc_set_parameters(NULL);
- /* main application waits for this flag during encoder removing */
- ci->enc_codec_loaded = 0;
-
return CODEC_OK;
} /* codec_start */
diff --git a/apps/codecs/wav_enc.c b/apps/codecs/wav_enc.c
index 193181d825..ef1a88ec23 100644
--- a/apps/codecs/wav_enc.c
+++ b/apps/codecs/wav_enc.c
@@ -349,16 +349,10 @@ static bool init_encoder(void)
enum codec_status codec_main(void)
{
if (!init_encoder())
- {
- ci->enc_codec_loaded = -1;
return CODEC_ERROR;
- }
-
- /* main application waits for this flag during encoder loading */
- ci->enc_codec_loaded = 1;
/* main encoding loop */
- while(!ci->stop_encoder)
+ while(!ci->stop_codec)
{
uint32_t *src;
@@ -366,7 +360,7 @@ enum codec_status codec_main(void)
{
struct enc_chunk_hdr *chunk;
- if (ci->stop_encoder)
+ if (ci->stop_codec)
break;
chunk = ci->enc_get_chunk();
@@ -386,8 +380,5 @@ enum codec_status codec_main(void)
/* reset parameters to initial state */
ci->enc_set_parameters(NULL);
- /* main application waits for this flag during encoder removing */
- ci->enc_codec_loaded = 0;
-
return CODEC_OK;
} /* codec_start */
diff --git a/apps/codecs/wavpack_enc.c b/apps/codecs/wavpack_enc.c
index 66263cf1a1..d908e284be 100644
--- a/apps/codecs/wavpack_enc.c
+++ b/apps/codecs/wavpack_enc.c
@@ -393,16 +393,10 @@ enum codec_status codec_main(void)
{
/* initialize params and config */
if (!init_encoder())
- {
- ci->enc_codec_loaded = -1;
return CODEC_ERROR;
- }
-
- /* main application waits for this flag during encoder loading */
- ci->enc_codec_loaded = 1;
/* main encoding loop */
- while(!ci->stop_encoder)
+ while(!ci->stop_codec)
{
uint8_t *src;
@@ -413,7 +407,7 @@ enum codec_status codec_main(void)
uint8_t *dst;
uint8_t *src_end;
- if(ci->stop_encoder)
+ if(ci->stop_codec)
break;
abort_chunk = true;
@@ -442,7 +436,7 @@ enum codec_status codec_main(void)
chunk->num_pcm += PCM_SAMP_PER_CHUNK/4;
ci->yield();
/* could've been stopped in some way */
- abort_chunk = ci->stop_encoder ||
+ abort_chunk = ci->stop_codec ||
(chunk->flags & CHUNKF_ABORT);
}
@@ -467,8 +461,5 @@ enum codec_status codec_main(void)
/* reset parameters to initial state */
ci->enc_set_parameters(NULL);
- /* main application waits for this flag during encoder removing */
- ci->enc_codec_loaded = 0;
-
return CODEC_OK;
} /* codec_start */