summaryrefslogtreecommitdiff
path: root/apps/codecs/smaf.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/smaf.c')
-rw-r--r--apps/codecs/smaf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/codecs/smaf.c b/apps/codecs/smaf.c
index 6763e95001..3e8a41387d 100644
--- a/apps/codecs/smaf.c
+++ b/apps/codecs/smaf.c
@@ -334,7 +334,7 @@ static uint8_t *read_buffer(size_t *realsize)
334 334
335enum codec_status codec_main(void) 335enum codec_status codec_main(void)
336{ 336{
337 int status = CODEC_OK; 337 int status;
338 uint32_t decodedsamples; 338 uint32_t decodedsamples;
339 size_t n; 339 size_t n;
340 int bufcount; 340 int bufcount;
@@ -347,13 +347,15 @@ enum codec_status codec_main(void)
347 ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); 347 ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1);
348 348
349next_track: 349next_track:
350 status = CODEC_OK;
351
350 if (codec_init()) { 352 if (codec_init()) {
351 status = CODEC_ERROR; 353 status = CODEC_ERROR;
352 goto exit; 354 goto exit;
353 } 355 }
354 356
355 while (!*ci->taginfo_ready && !ci->stop_codec) 357 if (codec_wait_taginfo() != 0)
356 ci->sleep(1); 358 goto done;
357 359
358 codec_set_replaygain(ci->id3); 360 codec_set_replaygain(ci->id3);
359 361
@@ -479,7 +481,6 @@ next_track:
479 481
480 ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency); 482 ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency);
481 } 483 }
482 status = CODEC_OK;
483 484
484done: 485done:
485 if (ci->request_next_track()) 486 if (ci->request_next_track())