diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-09-30 22:45:55 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-10-03 16:03:32 -0400 |
commit | 892695c851a427beef314841ea54b01be40dd0e8 (patch) | |
tree | d0221e8be83c2ec23bc890992cc865f6c40cf3bc | |
parent | 27c3f9c03e1d0290dfd6e185b75acdf463bdb7b2 (diff) | |
download | ffmpeg-892695c851a427beef314841ea54b01be40dd0e8.tar.gz |
libspeexdec: simplify setting of frame_size
-rw-r--r-- | libavcodec/libspeexdec.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 21c9d05428..d1180931d5 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -49,7 +49,6 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_S16; if (s->header) { avctx->channels = s->header->nb_channels; - s->frame_size = s->header->frame_size; spx_mode = s->header->mode; } else { switch (avctx->sample_rate) { @@ -71,6 +70,7 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } avctx->sample_rate = 8000 << spx_mode; + s->frame_size = 160 << spx_mode; if (avctx->channels < 1 || avctx->channels > 2) { /* libspeex can handle mono or stereo if initialized as stereo */ @@ -88,10 +88,6 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) return -1; } - if (!s->header) { - speex_decoder_ctl(s->dec_state, SPEEX_GET_FRAME_SIZE, &s->frame_size); - } - if (avctx->channels == 2) { SpeexCallback callback; callback.callback_id = SPEEX_INBAND_STEREO; |