diff options
author | Piotr Bandurski <ami_stuff@o2.pl> | 2013-01-16 19:32:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-23 15:45:58 +0100 |
commit | e26b066cd8db361feba90e943c6cfdf062c52272 (patch) | |
tree | a13ffda35ad957c74ca8c9666ea5e96f1bc8f0b4 /libavcodec | |
parent | 785b849f1c231698ba66468bc35c393fa99b270c (diff) | |
download | ffmpeg-e26b066cd8db361feba90e943c6cfdf062c52272.tar.gz |
libspeex: support ZygoAudio (quality 10 mode)
Fixes "quality 10" mode from Ticket1873
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libspeexdec.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 7c1ffa6f67..213eee4edb 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -50,7 +50,17 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) if (!header) av_log(avctx, AV_LOG_WARNING, "Invalid Speex header\n"); } - if (header) { + if (avctx->codec_tag == MKTAG('S', 'P', 'X', 'N')) { + if (!avctx->extradata || avctx->extradata && avctx->extradata_size < 47) { + av_log(avctx, AV_LOG_ERROR, "Missing or invalid extradata.\n"); + return AVERROR_INVALIDDATA; + } + if (avctx->extradata[37] != 10) { + av_log(avctx, AV_LOG_ERROR, "Unsupported quality mode.\n"); + return AVERROR_PATCHWELCOME; + } + spx_mode = 0; + } else if (header) { avctx->sample_rate = header->rate; avctx->channels = header->nb_channels; spx_mode = header->mode; |