RC: Fix initial buffer occupancy.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Jan 2012 03:30:59 +0000 (04:30 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Jan 2012 05:46:24 +0000 (06:46 +0100)
Fixes Ticket880
Regression since bf174a70cde333eba7e27063f9ce44497108f466

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ratecontrol.c

index e49df8b..9d98b9a 100644 (file)
@@ -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;