]> granicus.if.org Git - libx264/commitdiff
Fix VBV overflow check for B-frames
authorAnton Mitrofanov <BugMaster@narod.ru>
Mon, 1 Feb 2021 19:32:37 +0000 (22:32 +0300)
committerAnton Mitrofanov <BugMaster@narod.ru>
Mon, 1 Feb 2021 19:32:37 +0000 (22:32 +0300)
encoder/ratecontrol.c

index e52270ba41933e3894c035b13721a3e3611d26e6..b106be160e7d818160368c2ce3a10725f3b40a57 100644 (file)
@@ -2350,7 +2350,10 @@ static double clip_qscale( x264_t *h, int pict_type, double q )
                 bframe_cpb_duration += h->fenc->f_planned_cpb_duration[i];
 
             if( bbits * nb > bframe_cpb_duration * rcc->vbv_max_rate )
+            {
                 nb = 0;
+                bframe_cpb_duration = 0;
+            }
             pbbits += nb * bbits;
 
             minigop_cpb_duration = bframe_cpb_duration + fenc_cpb_duration;