mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-09 14:07:31 +02:00
nellymoserenc: return AVERROR codes instead of -1
This commit is contained in:
parent
6f600ab354
commit
333506c33f
@ -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)
|
|||||||
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user