From: Anton Mitrofanov Date: Tue, 25 May 2010 14:45:16 +0000 (+0400) Subject: Fix calculation of total bitrate printed after stop by CTRL+C X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=e627569c623d2cd0423c94e9499dec4844039139;p=x264.git Fix calculation of total bitrate printed after stop by CTRL+C --- diff --git a/x264.c b/x264.c index c4a74009..3a018542 100644 --- 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) )