Commit 333506c3 authored by Justin Ruggles's avatar Justin Ruggles

nellymoserenc: return AVERROR codes instead of -1

parent 6f600ab3
...@@ -134,7 +134,7 @@ static av_cold int encode_init(AVCodecContext *avctx) ...@@ -134,7 +134,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (avctx->channels != 1) { if (avctx->channels != 1) {
av_log(avctx, AV_LOG_ERROR, "Nellymoser supports only 1 channel\n"); av_log(avctx, AV_LOG_ERROR, "Nellymoser supports only 1 channel\n");
return -1; return AVERROR(EINVAL);
} }
if (avctx->sample_rate != 8000 && avctx->sample_rate != 16000 && if (avctx->sample_rate != 8000 && avctx->sample_rate != 16000 &&
...@@ -142,7 +142,7 @@ static av_cold int encode_init(AVCodecContext *avctx) ...@@ -142,7 +142,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
avctx->sample_rate != 22050 && avctx->sample_rate != 44100 && avctx->sample_rate != 22050 && avctx->sample_rate != 44100 &&
avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) { avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 16000, 11025, 22050 and 44100 sample rate\n"); av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 16000, 11025, 22050 and 44100 sample rate\n");
return -1; return AVERROR(EINVAL);
} }
avctx->frame_size = NELLY_SAMPLES; avctx->frame_size = NELLY_SAMPLES;
......
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