diff options
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/speex.c | 20 |
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; | ||
565 | done: | 566 | done: |
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); |