diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-03-07 07:15:21 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-03-07 07:15:21 +0000 |
commit | f640b89a12eb6a222c0371624fe56a2a6dd6d649 (patch) | |
tree | b7d4ea57d7ce48e23f1d23ba61375e35c371c92f /apps/codecs/smaf.c | |
parent | 792f7335af244ced7e467047a0e450998547fa2e (diff) | |
download | rockbox-f640b89a12eb6a222c0371624fe56a2a6dd6d649.tar.gz rockbox-f640b89a12eb6a222c0371624fe56a2a6dd6d649.zip |
wave codec
- does not get dwAvgBytesPerSec
wave/aiff/smaf/wave64 codec
- corrects the problem that codec_main() returns invalid value.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25051 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/smaf.c')
-rw-r--r-- | apps/codecs/smaf.c | 19 |
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 | ||
290 | next_track: | 289 | next_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 | ||
428 | done: | 427 | done: |
429 | if (ci->request_next_track()) | 428 | if (ci->request_next_track()) |
430 | goto next_track; | 429 | goto next_track; |
431 | 430 | ||
432 | exit: | 431 | exit: |
433 | return i; | 432 | return status; |
434 | } | 433 | } |
435 | 434 | ||