[x264-devel] commit: Fix abstraction violations in x264.c (Jason Garrett-Glaser )

git version control git at videolan.org
Sat Jan 30 13:58:01 CET 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Fri Jan 29 11:01:44 2010 -0800| [63b74d874328e630ecb7eaa37cf780c45b992f0e] | committer: Jason Garrett-Glaser 

Fix abstraction violations in x264.c
No calling application--not even x264cli--should ever look inside x264_t.

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

 x264.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/x264.c b/x264.c
index 8669cb3..7098b0f 100644
--- a/x264.c
+++ b/x264.c
@@ -1498,14 +1498,14 @@ static int  Encode( x264_param_t *param, cli_opt_t *opt )
 
     i_start = x264_mdate();
     /* ticks/frame = ticks/second / frames/second */
-    ticks_per_frame = (int64_t)h->param.i_timebase_den * h->param.i_fps_den / h->param.i_timebase_num / h->param.i_fps_num;
+    ticks_per_frame = (int64_t)param->i_timebase_den * param->i_fps_den / param->i_timebase_num / param->i_fps_num;
     if( ticks_per_frame < 1 )
     {
         fprintf( stderr, "x264 [error]: ticks_per_frame invalid: %"PRId64"\n", ticks_per_frame );
         return -1;
     }
 
-    if( !h->param.b_repeat_headers )
+    if( !param->b_repeat_headers )
     {
         // Write SPS/PPS/SEI
         x264_nal_t *headers;
@@ -1531,9 +1531,9 @@ static int  Encode( x264_param_t *param, cli_opt_t *opt )
             pic.i_pts = i_frame;
         if( pic.i_pts <= largest_pts )
         {
-            if( h->param.i_log_level >= X264_LOG_WARNING )
+            if( param->i_log_level >= X264_LOG_WARNING )
             {
-                if( h->param.i_log_level >= X264_LOG_DEBUG || pts_warning_cnt < MAX_PTS_WARNING )
+                if( param->i_log_level >= X264_LOG_DEBUG || pts_warning_cnt < MAX_PTS_WARNING )
                     fprintf( stderr, "x264 [warning]: non-strictly-monotonic pts at frame %d (%"PRId64" <= %"PRId64")\n",
                              i_frame, pic.i_pts * dts_compress_multiplier, largest_pts * dts_compress_multiplier );
                 else if( pts_warning_cnt == MAX_PTS_WARNING )
@@ -1582,7 +1582,7 @@ static int  Encode( x264_param_t *param, cli_opt_t *opt )
         if( opt->b_progress && i_frame_output % i_update_interval == 0 && i_frame_output )
             Print_status( i_start, i_frame_output, i_frame_total, i_file, param, last_pts );
     }
-    if( pts_warning_cnt >= MAX_PTS_WARNING && h->param.i_log_level < X264_LOG_DEBUG )
+    if( pts_warning_cnt >= MAX_PTS_WARNING && param->i_log_level < X264_LOG_DEBUG )
         fprintf( stderr, "x264 [warning]: %d suppressed nonmonotonic pts warnings\n", pts_warning_cnt-MAX_PTS_WARNING );
 
     /* duration algorithm fails when only 1 frame is output */



More information about the x264-devel mailing list