summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-05-01 04:23:30 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-05-01 04:23:30 +0000
commit5e57edf2632eb69b0749a9af984fa399a487bec4 (patch)
tree47c29efec92b79feeac9fd3f3f1a32d29a403d0c
parentd955dc4ead159e5dc4c99c5ccf9fd81e1e8073b5 (diff)
downloadrockbox-5e57edf2632eb69b0749a9af984fa399a487bec4.tar.gz
rockbox-5e57edf2632eb69b0749a9af984fa399a487bec4.zip
Clean up speex a bit after the playback changes in r29785. Haven't found any idiosyncracies not present before then. Fix it always returning CODEC_ERROR even when exiting codec_run normally.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29804 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/speex.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/codecs/speex.c b/apps/codecs/speex.c
index 85ee9c422c..0a81993605 100644
--- a/apps/codecs/speex.c
+++ b/apps/codecs/speex.c
@@ -386,19 +386,22 @@ enum codec_status codec_run(void)
386 spx_ogg_page og; 386 spx_ogg_page og;
387 spx_ogg_packet op; 387 spx_ogg_packet op;
388 spx_ogg_stream_state os; 388 spx_ogg_stream_state os;
389 spx_int64_t page_granule = 0, cur_granule = 0; 389 spx_int64_t page_granule = 0;
390 spx_int64_t cur_granule = 0;
390 int enh_enabled = 1; 391 int enh_enabled = 1;
391 int nframes = 2; 392 int nframes = 2;
392 int eos = 0; 393 int eos = 0;
393 SpeexStereoState *stereo; 394 SpeexStereoState *stereo;
394 int channels = -1; 395 int channels = -1;
395 int samplerate = 0; 396 int samplerate = ci->id3->frequency;
396 int extra_headers = 0; 397 int extra_headers = 0;
397 int stream_init = 0; 398 int stream_init = 0;
398 int page_nb_packets, frame_size, packet_count = 0; 399 int page_nb_packets;
400 int frame_size;
401 int packet_count = 0;
399 int lookahead; 402 int lookahead;
400 int headerssize = -1; 403 int headerssize = 0;
401 unsigned long strtoffset = 0; 404 unsigned long strtoffset = ci->id3->offset;
402 void *st = NULL; 405 void *st = NULL;
403 int j = 0; 406 int j = 0;
404 intptr_t param; 407 intptr_t param;
@@ -417,9 +420,6 @@ enum codec_status codec_run(void)
417 spx_ogg_sync_init(&oy); 420 spx_ogg_sync_init(&oy);
418 spx_ogg_alloc_buffer(&oy,2*CHUNKSIZE); 421 spx_ogg_alloc_buffer(&oy,2*CHUNKSIZE);
419 422
420 strtoffset = ci->id3->offset;
421
422 samplerate = ci->id3->frequency;
423 codec_set_replaygain(ci->id3); 423 codec_set_replaygain(ci->id3);
424 424
425 eof = 0; 425 eof = 0;
@@ -562,13 +562,13 @@ next_page:
562 } 562 }
563 } 563 }
564 564
565 error = CODEC_OK;
565done: 566done:
566 /* Clean things up for the next track */ 567 /* Clean things up for the next track */
567 speex_bits_destroy(&bits); 568 speex_bits_destroy(&bits);
568 569
569 if (st) 570 if (st)
570 if (st) 571 speex_decoder_destroy(st);
571 speex_decoder_destroy(st);
572 572
573 if (stream_init) 573 if (stream_init)
574 spx_ogg_stream_destroy(&os); 574 spx_ogg_stream_destroy(&os);