diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-02 14:15:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-02 14:20:33 +0100 |
commit | 6788350281c418f0f395a8279eee82f7abe7c63b (patch) | |
tree | 69cd76f699eff929f5b13f76b42eabc7f25f9355 /libavcodec/g726.c | |
parent | 00aa7fa786e41b5fc8404732453869aa3c14e33a (diff) | |
parent | 50a65e7a540ce6747f81d6dbf6a602ad35be77ff (diff) | |
download | ffmpeg-6788350281c418f0f395a8279eee82f7abe7c63b.tar.gz |
Merge commit '50a65e7a540ce6747f81d6dbf6a602ad35be77ff'
* commit '50a65e7a540ce6747f81d6dbf6a602ad35be77ff': (24 commits)
vmdaudio: set channel layout
twinvq: validate sample rate code
twinvq: set channel layout
twinvq: validate that channels is not <= 0
truespeech: set channel layout
sipr: set channel layout
shorten: validate that the channel count in the header is not <= 0
ra288dec: set channel layout
ra144dec: set channel layout
qdm2: remove unneeded checks for channel count
qdm2: make sure channels is not <= 0 and set channel layout
qcelpdec: set channel layout
nellymoserdec: set channels to 1
libopencore-amr: set channel layout for amr-nb or if not set by the user
libilbc: set channel layout
dpcm: use AVCodecContext.channels instead of keeping a private copy
imc: set channels to 1 instead of validating it
gsmdec: always set channel layout and sample rate at initialization
libgsmdec: always set channel layout and sample rate at initialization
g726dec: do not validate sample rate
...
Conflicts:
libavcodec/dpcm.c
libavcodec/qdm2.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/g726.c')
-rw-r--r-- | libavcodec/g726.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c index b2f21fd6ca..609882ed7d 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -22,6 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <limits.h> + +#include "libavutil/audioconvert.h" #include "libavutil/avassert.h" #include "libavutil/opt.h" #include "avcodec.h" @@ -418,18 +420,8 @@ static av_cold int g726_decode_init(AVCodecContext *avctx) { G726Context* c = avctx->priv_data; - if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT && - avctx->sample_rate != 8000) { - av_log(avctx, AV_LOG_ERROR, "Only 8kHz sample rate is allowed when " - "the compliance level is strict. Reduce the compliance level " - "if you wish to decode the stream anyway.\n"); - return AVERROR(EINVAL); - } - - if(avctx->channels != 1){ - av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n"); - return AVERROR(EINVAL); - } + avctx->channels = 1; + avctx->channel_layout = AV_CH_LAYOUT_MONO; c->code_size = avctx->bits_per_coded_sample; if (c->code_size < 2 || c->code_size > 5) { |