Commit 30eb4abc authored by Fiona Glaser's avatar Fiona Glaser

Use x264_log in more places instead of fprintf

parent 89183a0e
...@@ -262,7 +262,7 @@ static int x264_param_apply_preset( x264_param_t *param, const char *preset ) ...@@ -262,7 +262,7 @@ static int x264_param_apply_preset( x264_param_t *param, const char *preset )
} }
else else
{ {
fprintf( stderr, "x264 [error]: invalid preset '%s'\n", preset ); x264_log( NULL, X264_LOG_ERROR, "invalid preset '%s'\n", preset );
return -1; return -1;
} }
return 0; return 0;
...@@ -349,14 +349,14 @@ static int x264_param_apply_tune( x264_param_t *param, const char *tune ) ...@@ -349,14 +349,14 @@ static int x264_param_apply_tune( x264_param_t *param, const char *tune )
} }
else else
{ {
fprintf( stderr, "x264 [error]: invalid tune '%s'\n", s ); x264_log( NULL, X264_LOG_ERROR, "invalid tune '%s'\n", s );
x264_free( tmp ); x264_free( tmp );
return -1; return -1;
} }
if( 0 ) if( 0 )
{ {
psy_failure: 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, ",./-+" ); s = strtok( NULL, ",./-+" );
} }
...@@ -403,7 +403,7 @@ int x264_param_apply_profile( x264_param_t *param, const char *profile ) ...@@ -403,7 +403,7 @@ int x264_param_apply_profile( x264_param_t *param, const char *profile )
param->analyse.i_weighted_pred = X264_WEIGHTP_NONE; param->analyse.i_weighted_pred = X264_WEIGHTP_NONE;
if( param->b_interlaced ) 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; return -1;
} }
} }
...@@ -418,13 +418,13 @@ int x264_param_apply_profile( x264_param_t *param, const char *profile ) ...@@ -418,13 +418,13 @@ int x264_param_apply_profile( x264_param_t *param, const char *profile )
} }
else else
{ {
fprintf( stderr, "x264 [error]: invalid profile: %s\n", profile ); x264_log( NULL, X264_LOG_ERROR, "invalid profile: %s\n", profile );
return -1; return -1;
} }
if( (param->rc.i_rc_method == X264_RC_CQP && param->rc.i_qp_constant == 0) || 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) ) (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 -1;
} }
return 0; return 0;
......
...@@ -213,7 +213,7 @@ uint32_t x264_cpu_detect( void ) ...@@ -213,7 +213,7 @@ uint32_t x264_cpu_detect( void )
else if( cache == 64 ) else if( cache == 64 )
cpu |= X264_CPU_CACHELINE_64; cpu |= X264_CPU_CACHELINE_64;
else 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 #ifdef BROKEN_STACK_ALIGNMENT
......
...@@ -3322,13 +3322,13 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a ) ...@@ -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 ) 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"); x264_log( h, X264_LOG_WARNING, "internal error (MV out of thread range)\n");
fprintf(stderr, "mb type: %d \n", h->mb.i_type); x264_log( h, X264_LOG_DEBUG, "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, "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]][0],
h->mb.cache.mv[l][x264_scan8[15]][1] ); h->mb.cache.mv[l][x264_scan8[15]][1] );
fprintf(stderr, "limit: %d \n", h->mb.mv_max_spel[1]); x264_log( h, X264_LOG_DEBUG, "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); x264_log( h, X264_LOG_DEBUG, "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, "completed: %d \n", completed );
x264_log( h, X264_LOG_WARNING, "recovering by using intra mode\n"); x264_log( h, X264_LOG_WARNING, "recovering by using intra mode\n");
x264_mb_analyse_intra( h, a, COST_MAX ); x264_mb_analyse_intra( h, a, COST_MAX );
h->mb.i_type = I_16x16; h->mb.i_type = I_16x16;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment