]> git.sesse.net Git - x264/commitdiff
Fix calculation of total bitrate printed after stop by CTRL+C
authorAnton Mitrofanov <BugMaster@narod.ru>
Tue, 25 May 2010 14:45:16 +0000 (18:45 +0400)
committerFiona Glaser <fiona@x264.com>
Wed, 26 May 2010 09:06:36 +0000 (02:06 -0700)
x264.c

diff --git a/x264.c b/x264.c
index c4a740094d861198a6c4ecaf2b4f329d07d27274..3a01854255bacb94fde5dc0158c997fd55dd0c77 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -1560,6 +1560,8 @@ static int  Encode( x264_param_t *param, cli_opt_t *opt )
     /* duration algorithm fails when only 1 frame is output */
     if( i_frame_output == 1 )
         duration = (double)param->i_fps_den / param->i_fps_num;
+    else if( b_ctrl_c )
+        duration = (double)(2 * last_dts - prev_dts - first_dts) * param->i_timebase_num / param->i_timebase_den;
     else
         duration = (double)(2 * largest_pts - second_largest_pts) * param->i_timebase_num / param->i_timebase_den;
     if( !(opt->i_pulldown && !param->b_vfr_input) )