summaryrefslogtreecommitdiff
path: root/apps/codecs/wav.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/wav.c')
-rw-r--r--apps/codecs/wav.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c
index e286f4dc6a..e179470f27 100644
--- a/apps/codecs/wav.c
+++ b/apps/codecs/wav.c
@@ -153,7 +153,7 @@ static uint8_t *read_buffer(size_t *realsize)
153/* this is the codec entry point */ 153/* this is the codec entry point */
154enum codec_status codec_main(void) 154enum codec_status codec_main(void)
155{ 155{
156 int status = CODEC_OK; 156 int status;
157 uint32_t decodedsamples; 157 uint32_t decodedsamples;
158 size_t n; 158 size_t n;
159 int bufcount; 159 int bufcount;
@@ -168,14 +168,16 @@ enum codec_status codec_main(void)
168 ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); 168 ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1);
169 169
170next_track: 170next_track:
171 status = CODEC_OK;
172
171 if (codec_init()) { 173 if (codec_init()) {
172 DEBUGF("codec_init() error\n"); 174 DEBUGF("codec_init() error\n");
173 status = CODEC_ERROR; 175 status = CODEC_ERROR;
174 goto exit; 176 goto exit;
175 } 177 }
176 178
177 while (!*ci->taginfo_ready && !ci->stop_codec) 179 if (codec_wait_taginfo() != 0)
178 ci->sleep(1); 180 goto done;
179 181
180 codec_set_replaygain(ci->id3); 182 codec_set_replaygain(ci->id3);
181 183
@@ -437,7 +439,6 @@ next_track:
437 endofstream = 1; 439 endofstream = 1;
438 ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency); 440 ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency);
439 } 441 }
440 status = CODEC_OK;
441 442
442done: 443done:
443 if (ci->request_next_track()) 444 if (ci->request_next_track())