diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-18 05:36:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-28 01:36:44 +0100 |
commit | f21b6159cf3110a5f018d6addf7382840d427199 (patch) | |
tree | f4c207a86dd79ddfab7427bec7e260a27662de06 /libavcodec | |
parent | 49f2056289ab61be8803e86ca4cb0a6fd3116ead (diff) | |
download | ffmpeg-f21b6159cf3110a5f018d6addf7382840d427199.tar.gz |
mpegvideoenc: Fail if a buffer size is specified without a max rate.
This combination makes not much sense.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index fd31edc481..45dcea076b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -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; } |