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.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/apps/codecs/smaf.c b/apps/codecs/smaf.c
index fccb6cbc64..9309937700 100644
--- a/apps/codecs/smaf.c
+++ b/apps/codecs/smaf.c
@@ -276,7 +276,6 @@ enum codec_status codec_main(void)
276{ 276{
277 int status = CODEC_OK; 277 int status = CODEC_OK;
278 uint32_t decodedsamples; 278 uint32_t decodedsamples;
279 uint32_t i = CODEC_OK;
280 size_t n; 279 size_t n;
281 int bufcount; 280 int bufcount;
282 int endofstream; 281 int endofstream;
@@ -289,7 +288,7 @@ enum codec_status codec_main(void)
289 288
290next_track: 289next_track:
291 if (codec_init()) { 290 if (codec_init()) {
292 i = CODEC_ERROR; 291 status = CODEC_ERROR;
293 goto exit; 292 goto exit;
294 } 293 }
295 294
@@ -307,7 +306,7 @@ next_track:
307 306
308 if (!parse_header(&format, &n)) 307 if (!parse_header(&format, &n))
309 { 308 {
310 i = CODEC_ERROR; 309 status = CODEC_ERROR;
311 goto done; 310 goto done;
312 } 311 }
313 312
@@ -315,13 +314,13 @@ next_track:
315 if (codec == 0) 314 if (codec == 0)
316 { 315 {
317 DEBUGF("CODEC_ERROR: unsupport audio format: 0x%x\n", (int)format.formattag); 316 DEBUGF("CODEC_ERROR: unsupport audio format: 0x%x\n", (int)format.formattag);
318 i = CODEC_ERROR; 317 status = CODEC_ERROR;
319 goto done; 318 goto done;
320 } 319 }
321 320
322 if (!codec->set_format(&format)) 321 if (!codec->set_format(&format))
323 { 322 {
324 i = CODEC_ERROR; 323 status = CODEC_ERROR;
325 goto done; 324 goto done;
326 } 325 }
327 326
@@ -339,7 +338,7 @@ next_track:
339 if (format.blockalign == 0) 338 if (format.blockalign == 0)
340 { 339 {
341 DEBUGF("CODEC_ERROR: 'fmt ' chunk not found or 0-blockalign file\n"); 340 DEBUGF("CODEC_ERROR: 'fmt ' chunk not found or 0-blockalign file\n");
342 i = CODEC_ERROR; 341 status = CODEC_ERROR;
343 goto done; 342 goto done;
344 } 343 }
345 if (format.numbytes == 0) { 344 if (format.numbytes == 0) {
@@ -355,7 +354,7 @@ next_track:
355 if (format.chunksize == 0) 354 if (format.chunksize == 0)
356 { 355 {
357 DEBUGF("CODEC_ERROR: chunksize is 0\n"); 356 DEBUGF("CODEC_ERROR: chunksize is 0\n");
358 i = CODEC_ERROR; 357 status = CODEC_ERROR;
359 goto done; 358 goto done;
360 } 359 }
361 360
@@ -367,7 +366,7 @@ next_track:
367 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO); 366 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
368 } else { 367 } else {
369 DEBUGF("CODEC_ERROR: more than 2 channels unsupported\n"); 368 DEBUGF("CODEC_ERROR: more than 2 channels unsupported\n");
370 i = CODEC_ERROR; 369 status = CODEC_ERROR;
371 goto done; 370 goto done;
372 } 371 }
373 372
@@ -423,13 +422,13 @@ next_track:
423 422
424 ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency); 423 ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency);
425 } 424 }
426 i = CODEC_OK; 425 status = CODEC_OK;
427 426
428done: 427done:
429 if (ci->request_next_track()) 428 if (ci->request_next_track())
430 goto next_track; 429 goto next_track;
431 430
432exit: 431exit:
433 return i; 432 return status;
434} 433}
435 434