Commit 50969c0f authored by Justin Ruggles's avatar Justin Ruggles

g726: return AVERROR(EINVAL) instead of -1 for invalid channel count

parent 50c466d6
...@@ -314,7 +314,7 @@ static av_cold int g726_encode_init(AVCodecContext *avctx) ...@@ -314,7 +314,7 @@ static av_cold int g726_encode_init(AVCodecContext *avctx)
if(avctx->channels != 1){ if(avctx->channels != 1){
av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n"); av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
return -1; return AVERROR(EINVAL);
} }
if (avctx->bit_rate % avctx->sample_rate) { if (avctx->bit_rate % avctx->sample_rate) {
...@@ -381,7 +381,7 @@ static av_cold int g726_decode_init(AVCodecContext *avctx) ...@@ -381,7 +381,7 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
if(avctx->channels != 1){ if(avctx->channels != 1){
av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n"); av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
return -1; return AVERROR(EINVAL);
} }
c->code_size = avctx->bits_per_coded_sample; c->code_size = avctx->bits_per_coded_sample;
......
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