Commit e00eb03c authored by Justin Ruggles's avatar Justin Ruggles

g726dec: set channel layout at initialization instead of validating it

parent 99d86863
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <limits.h> #include <limits.h>
#include "libavutil/audioconvert.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "avcodec.h" #include "avcodec.h"
...@@ -428,10 +430,8 @@ static av_cold int g726_decode_init(AVCodecContext *avctx) ...@@ -428,10 +430,8 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if(avctx->channels != 1){ avctx->channels = 1;
av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n"); avctx->channel_layout = AV_CH_LAYOUT_MONO;
return AVERROR(EINVAL);
}
c->code_size = avctx->bits_per_coded_sample; c->code_size = avctx->bits_per_coded_sample;
if (c->code_size < 2 || c->code_size > 5) { if (c->code_size < 2 || c->code_size > 5) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment