[x264-devel] commit: Fix calculation of total bitrate printed after stop by CTRL+C ( Anton Mitrofanov )

git at videolan.org git at videolan.org
Wed May 26 19:39:33 CEST 2010


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue May 25 18:45:16 2010 +0400| [e627569c623d2cd0423c94e9499dec4844039139] | committer: Jason Garrett-Glaser 

Fix calculation of total bitrate printed after stop by CTRL+C

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e627569c623d2cd0423c94e9499dec4844039139
---

 x264.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/x264.c b/x264.c
index c4a7400..3a01854 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) )



More information about the x264-devel mailing list