X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibmp3lame.c;h=b540362d5c62f23648c728b6a1ba927254cc11ab;hb=e462257242fc037c99206457d1316e1ff9e5306f;hp=ec2155009befc8c5b3a922003b8d06bcccf36386;hpb=ef74ab20c255abf49b856c15f812cc9ea3fec061;p=ffmpeg diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index ec2155009be..b540362d5c6 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -49,8 +49,11 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx) { Mp3AudioContext *s = avctx->priv_data; - if (avctx->channels > 2) - return -1; + if (avctx->channels > 2) { + av_log(avctx, AV_LOG_ERROR, + "Invalid number of channels %d, must be <= 2\n", avctx->channels); + return AVERROR(EINVAL); + } s->stereo = avctx->channels > 1 ? 1 : 0; @@ -277,7 +280,7 @@ static av_cold int MP3lame_encode_close(AVCodecContext *avctx) #define OFFSET(x) offsetof(Mp3AudioContext, x) #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { - { "reservoir", "Use bit reservoir.", OFFSET(reservoir), FF_OPT_TYPE_INT, { 1 }, 0, 1, AE }, + { "reservoir", "Use bit reservoir.", OFFSET(reservoir), AV_OPT_TYPE_INT, { 1 }, 0, 1, AE }, { NULL }, };