summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-09-07 19:54:48 +0000
committerMåns Rullgård <mans@mansr.com>2010-09-07 19:54:48 +0000
commitb33451eeacaa31a7b4f15daf3f106763a4093aa0 (patch)
treec7df5c92ff49736288fed6f7dc569c836062953f /libavcodec/mpegvideo_enc.c
parent1904035bace6a9c6aadb089c259f3d1348d86e28 (diff)
Check rc_buffer_size value using integer arithmetic
Using floating-point here can cause erroneous rejection of parameters due to rounding errors leading to a slightly too large result. This fixes the mxf regression test with gcc 4.5 on x86_32. Originally committed as revision 25060 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 9f8682cae5..8fbd7595c1 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -351,7 +351,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_INFO, "impossible bitrate constraints, this will fail\n");
}
- if(avctx->rc_buffer_size && avctx->bit_rate*av_q2d(avctx->time_base) > avctx->rc_buffer_size){
+ if(avctx->rc_buffer_size && avctx->bit_rate*(int64_t)avctx->time_base.num > avctx->rc_buffer_size * (int64_t)avctx->time_base.den){
av_log(avctx, AV_LOG_ERROR, "VBV buffer too small for bitrate\n");
return -1;
}