diff -uNrp a/common/common.c b/common/common.c --- a/common/common.c 2010-02-24 10:20:41 +0200 +++ b/common/common.c 2010-03-03 19:33:57 +0200 @@ -259,7 +259,7 @@ static int x264_param_apply_preset( x264 } 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; @@ -345,14 +345,14 @@ static int x264_param_apply_tune( x264_p } 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, ",./-+" ); } @@ -399,7 +399,7 @@ int x264_param_apply_profile( x264_param 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; } } @@ -414,13 +414,13 @@ int x264_param_apply_profile( x264_param } 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; diff -uNrp a/common/cpu.c b/common/cpu.c --- a/common/cpu.c 2010-02-15 12:48:41 +0200 +++ b/common/cpu.c 2010-03-03 19:33:57 +0200 @@ -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 diff -uNrp a/common/macroblock.c b/common/macroblock.c --- a/common/macroblock.c 2010-02-28 13:25:46 +0200 +++ b/common/macroblock.c 2010-03-03 19:38:56 +0200 @@ -291,7 +291,7 @@ static int x264_mb_predict_mv_direct16x1 || mv[1][1] > h->mb.mv_max_spel[1] ) ) { #if 0 - fprintf(stderr, "direct_spatial: (%d,%d) (%d,%d) > %d \n", + x264_log( h, X264_LOG_DEBUG, "direct_spatial: (%d,%d) (%d,%d) > %d \n", mv[0][0], mv[0][1], mv[1][0], mv[1][1], h->mb.mv_max_spel[1]); #endif diff -uNrp a/encoder/analyse.c b/encoder/analyse.c --- a/encoder/analyse.c 2010-02-28 13:25:46 +0200 +++ b/encoder/analyse.c 2010-03-03 19:39:49 +0200 @@ -3204,13 +3204,13 @@ static void x264_analyse_update_cache( x 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;