From e627569c623d2cd0423c94e9499dec4844039139 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Tue, 25 May 2010 18:45:16 +0400 Subject: [PATCH] Fix calculation of total bitrate printed after stop by CTRL+C --- x264.c | 2 ++ 1 file changed, 2 insertions(+) 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) ) -- 2.47.3