]> git.videolan.org Git - x264.git/commitdiff
Fix printing of bitrate when timestamps aren't available
authorLoren Merritt <pengvado@akuvian.org>
Tue, 20 Apr 2010 09:17:18 +0000 (09:17 +0000)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Fri, 23 Apr 2010 19:40:23 +0000 (12:40 -0700)
Doesn't affect x264cli, but was broken in some other apps in CFR mode.

encoder/encoder.c

index f641f63896500e9447a7781352efd002aeec8187..3370eb4506337af174fa2f67d2f2315003dc0cf5 100644 (file)
@@ -2913,7 +2913,7 @@ void    x264_encoder_close  ( x264_t *h )
         float fps = (float) h->param.i_fps_num / h->param.i_fps_den;
         float f_bitrate;
         /* duration algorithm fails with one frame */
-        if( i_count == 1 )
+        if( !h->param.b_vfr_input || i_count == 1 )
             f_bitrate = fps * SUM3(h->stat.i_frame_size) / i_count / 125;
         else
         {