]> git.videolan.org Git - x264.git/commitdiff
fps patch by Haali
authorSteve Lhomme <robux@videolan.org>
Tue, 20 Sep 2005 16:18:23 +0000 (16:18 +0000)
committerSteve Lhomme <robux@videolan.org>
Tue, 20 Sep 2005 16:18:23 +0000 (16:18 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@295 df754926-b1dd-0310-bc7b-ec298dee348c

x264.c

diff --git a/x264.c b/x264.c
index c648d2633dc8ba11938428e88f3cd04ca7b76601..bc30e30be4837219dc0839357de1b6a296e69b23 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -1128,7 +1128,7 @@ static int  Encode( x264_param_t *param, cli_opt_t *opt )
         if( p_read_frame( &pic, opt->hin, i_frame + opt->i_seek, param->i_width, param->i_height ) )
             break;
 
-        pic.i_pts = i_frame * param->i_fps_den;
+        pic.i_pts = (int64_t)i_frame * param->i_fps_den;
 
         i_file += Encode_frame( h, opt->hout, &pic );
 
@@ -1801,8 +1801,7 @@ static int write_nalu_mkv( hnd_t handle, uint8_t *p_nalu, int i_size )
 static int set_eop_mkv( hnd_t handle, x264_picture_t *p_picture )
 {
     mkv_t *p_mkv = handle;
-    int64_t i_stamp = (int64_t)p_picture->i_pts * (int64_t)1000000000 /
-                      p_mkv->fps_num;
+    int64_t i_stamp = (int64_t)(p_picture->i_pts * 1e9 / p_mkv->fps_num);
 
     p_mkv->b_writing_frame = 0;