summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-02 02:58:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-02 02:58:08 +0200
commitc450cf1572e352ce8cf741247b191d213e230bd3 (patch)
treeb6b4e2b4e9a1a7f4476d80cd631d0c02477a7511 /libavcodec/mpegvideo_enc.c
parent49891784ce70456305f19847d4188f07bbc1b6e1 (diff)
libavcodec: be less picky on nonsense rc_max_rate / rc_buffer_size combinations.
Some applications use these combinations and to maintain ABI compatibility with previous versions we should not suddenly fail. Thus only display a warning for the newly detected cases Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 17a2512554..780bbd59d7 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -390,7 +390,8 @@ 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");
- return -1;
+ if (avctx->rc_max_rate && !avctx->rc_buffer_size)
+ return -1;
}
if (avctx->rc_min_rate && avctx->rc_max_rate != avctx->rc_min_rate) {