Commit f21b6159 authored by Michael Niedermayer's avatar Michael Niedermayer

mpegvideoenc: Fail if a buffer size is specified without a max rate.

This combination makes not much sense.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 49f20562
......@@ -392,10 +392,8 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
s->obmc = !!(s->flags & CODEC_FLAG_OBMC);
#endif
if (avctx->rc_max_rate && !avctx->rc_buffer_size) {
av_log(avctx, AV_LOG_ERROR,
"a vbv buffer size is needed, "
"for encoding with a maximum bitrate\n");
if ((!avctx->rc_max_rate) != (!avctx->rc_buffer_size)) {
av_log(avctx, AV_LOG_ERROR, "Either both buffer size and max rate or neither must be specified\n");
return -1;
}
......
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