X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fg726.c;h=609882ed7d44f68a43523e923de52c8a384e2afe;hb=78e08fd340e03b49f75e1ac31c20cc21434794bd;hp=b2f21fd6ca0cc3523508dc90903e3925296d20f5;hpb=8227d36bd3569efe0f1a4e3ad877e516497666a4;p=ffmpeg diff --git a/libavcodec/g726.c b/libavcodec/g726.c index b2f21fd6ca0..609882ed7d4 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 + +#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) {