avcodec/mpegvideo_enc: return proper error instead of failing assertion when max rate is not set

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-07-15 18:49:18 +02:00
parent 01c17b5224
commit 19e5114eaa
1 changed files with 1 additions and 2 deletions

View File

@ -388,8 +388,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
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");
if (avctx->rc_max_rate && !avctx->rc_buffer_size)
return -1;
return -1;
}
if (avctx->rc_min_rate && avctx->rc_max_rate != avctx->rc_min_rate) {