aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-22 04:30:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-22 06:46:24 +0100
commit9e34adfc02d4e1fd1750bdbb0d24c79a87fdd3e4 (patch)
treed8da65422ea1888be07bd32035006d5817e0d130
parent887cd591a8ba5a385cfdc84fdd5bb49c278e538c (diff)
downloadffmpeg-9e34adfc02d4e1fd1750bdbb0d24c79a87fdd3e4.tar.gz
RC: Fix initial buffer occupancy.
Fixes Ticket880 Regression since bf174a70cde333eba7e27063f9ce44497108f466 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/ratecontrol.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index e49df8b2a0..9d98b9a835 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -125,6 +125,8 @@ int ff_rate_control_init(MpegEncContext *s)
rcc->last_qscale_for[i]=FF_QP2LAMBDA * 5;
}
rcc->buffer_index= s->avctx->rc_initial_buffer_occupancy;
+ if (!rcc->buffer_index)
+ rcc->buffer_index = s->avctx->rc_buffer_size * 3 / 4;
if(s->flags&CODEC_FLAG_PASS2){
int i;