aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-09-30 23:09:19 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-10-03 16:03:32 -0400
commit908e22b93a9532948d62e43b700d5c91ea37db2a (patch)
tree432676b8ea64125ab4765b001b364e1ad90a5475
parent892695c851a427beef314841ea54b01be40dd0e8 (diff)
downloadffmpeg-908e22b93a9532948d62e43b700d5c91ea37db2a.tar.gz
libspeexdec: move the SpeexHeader from LibSpeexContext to where it is used
-rw-r--r--libavcodec/libspeexdec.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c
index d1180931d5..1916fea2d1 100644
--- a/libavcodec/libspeexdec.c
+++ b/libavcodec/libspeexdec.c
@@ -32,7 +32,6 @@ typedef struct {
SpeexBits bits;
SpeexStereoState stereo;
void *dec_state;
- SpeexHeader *header;
int frame_size;
} LibSpeexContext;
@@ -43,13 +42,13 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
const SpeexMode *mode;
int spx_mode;
- if (avctx->extradata_size >= 80)
- s->header = speex_packet_to_header(avctx->extradata, avctx->extradata_size);
-
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
- if (s->header) {
- avctx->channels = s->header->nb_channels;
- spx_mode = s->header->mode;
+ if (avctx->extradata && avctx->extradata_size >= 80) {
+ SpeexHeader *header = speex_packet_to_header(avctx->extradata,
+ avctx->extradata_size);
+ avctx->channels = header->nb_channels;
+ spx_mode = header->mode;
+ speex_header_free(header);
} else {
switch (avctx->sample_rate) {
case 8000: spx_mode = 0; break;
@@ -153,7 +152,6 @@ static av_cold int libspeex_decode_close(AVCodecContext *avctx)
{
LibSpeexContext *s = avctx->priv_data;
- speex_header_free(s->header);
speex_bits_destroy(&s->bits);
speex_decoder_destroy(s->dec_state);