Skip to content

Commit

Permalink
mpegvideoenc: Fail if a buffer size is specified without a max rate.
Browse files Browse the repository at this point in the history
This combination makes not much sense.

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Jan 28, 2012
1 parent 49f2056 commit f21b615
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libavcodec/mpegvideo_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f21b615

Please sign in to comment.