]> git.videolan.org Git - x264.git/commitdiff
Use x264_log in more places instead of fprintf
authorJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 3 Mar 2010 19:22:29 +0000 (11:22 -0800)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 27 Mar 2010 19:47:05 +0000 (12:47 -0700)
common/common.c
common/cpu.c
encoder/analyse.c

index 71fce02884e6eff452bc12323daaf78e6a797e48..73a848a248935ea486b7d7895b952d33dc52431a 100644 (file)
@@ -262,7 +262,7 @@ static int x264_param_apply_preset( x264_param_t *param, const char *preset )
     }
     else
     {
-        fprintf( stderr, "x264 [error]: invalid preset '%s'\n", preset );
+        x264_log( NULL, X264_LOG_ERROR, "invalid preset '%s'\n", preset );
         return -1;
     }
     return 0;
@@ -349,14 +349,14 @@ static int x264_param_apply_tune( x264_param_t *param, const char *tune )
         }
         else
         {
-            fprintf( stderr, "x264 [error]: invalid tune '%s'\n", s );
+            x264_log( NULL, X264_LOG_ERROR, "invalid tune '%s'\n", s );
             x264_free( tmp );
             return -1;
         }
         if( 0 )
         {
     psy_failure:
-            fprintf( stderr, "x264 [warning]: only 1 psy tuning can be used: ignoring tune %s\n", s );
+            x264_log( NULL, X264_LOG_WARNING, "only 1 psy tuning can be used: ignoring tune %s\n", s );
         }
         s = strtok( NULL, ",./-+" );
     }
@@ -403,7 +403,7 @@ int x264_param_apply_profile( x264_param_t *param, const char *profile )
         param->analyse.i_weighted_pred = X264_WEIGHTP_NONE;
         if( param->b_interlaced )
         {
-            fprintf( stderr, "x264 [error]: baseline profile doesn't support interlacing\n" );
+            x264_log( NULL, X264_LOG_ERROR, "baseline profile doesn't support interlacing\n" );
             return -1;
         }
     }
@@ -418,13 +418,13 @@ int x264_param_apply_profile( x264_param_t *param, const char *profile )
     }
     else
     {
-        fprintf( stderr, "x264 [error]: invalid profile: %s\n", profile );
+        x264_log( NULL, X264_LOG_ERROR, "invalid profile: %s\n", profile );
         return -1;
     }
     if( (param->rc.i_rc_method == X264_RC_CQP && param->rc.i_qp_constant == 0) ||
         (param->rc.i_rc_method == X264_RC_CRF && param->rc.f_rf_constant == 0) )
     {
-        fprintf( stderr, "x264 [error]: %s profile doesn't support lossless\n", profile );
+        x264_log( NULL, X264_LOG_ERROR, "%s profile doesn't support lossless\n", profile );
         return -1;
     }
     return 0;
index 9f2d5a655d35285150bb263315ed0cd8dc32ed88..23761ecf8f6fa765b32c5389a3db82f574ff801c 100644 (file)
@@ -213,7 +213,7 @@ uint32_t x264_cpu_detect( void )
         else if( cache == 64 )
             cpu |= X264_CPU_CACHELINE_64;
         else
-            fprintf( stderr, "x264 [warning]: unable to determine cacheline size\n" );
+            x264_log( NULL, X264_LOG_WARNING, "unable to determine cacheline size\n" );
     }
 
 #ifdef BROKEN_STACK_ALIGNMENT
index dfdea4c1cd7777e869f3aa79ba0ffb9322e6dba4..dce63eaa03afe4dfdf965b20d670e01a95f81b8c 100644 (file)
@@ -3322,13 +3322,13 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
             if( (h->mb.cache.mv[l][x264_scan8[15]][1] >> (2 - h->mb.b_interlaced)) + h->mb.i_mb_y*16 > completed )
             {
                 x264_log( h, X264_LOG_WARNING, "internal error (MV out of thread range)\n");
-                fprintf(stderr, "mb type: %d \n", h->mb.i_type);
-                fprintf(stderr, "mv: l%dr%d (%d,%d) \n", l, ref,
+                x264_log( h, X264_LOG_DEBUG, "mb type: %d \n", h->mb.i_type);
+                x264_log( h, X264_LOG_DEBUG, "mv: l%dr%d (%d,%d) \n", l, ref,
                                 h->mb.cache.mv[l][x264_scan8[15]][0],
                                 h->mb.cache.mv[l][x264_scan8[15]][1] );
-                fprintf(stderr, "limit: %d \n", h->mb.mv_max_spel[1]);
-                fprintf(stderr, "mb_xy: %d,%d \n", h->mb.i_mb_x, h->mb.i_mb_y);
-                fprintf(stderr, "completed: %d \n", completed );
+                x264_log( h, X264_LOG_DEBUG, "limit: %d \n", h->mb.mv_max_spel[1]);
+                x264_log( h, X264_LOG_DEBUG, "mb_xy: %d,%d \n", h->mb.i_mb_x, h->mb.i_mb_y);
+                x264_log( h, X264_LOG_DEBUG, "completed: %d \n", completed );
                 x264_log( h, X264_LOG_WARNING, "recovering by using intra mode\n");
                 x264_mb_analyse_intra( h, a, COST_MAX );
                 h->mb.i_type = I_16x16;