diff --git a/cmdutils.c b/cmdutils.c index e47807e49f887efe0629d771cc11618bb5f28b9b..309b99f7a6e3c1b0a7af746ed8d90f9edb785de2 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -17,8 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define HAVE_AV_CONFIG_H -#include "common.h" #include "avformat.h" +#include "common.h" #include "cmdutils.h" diff --git a/libavcodec/common.h b/libavcodec/common.h index c48f5f1a542e5e8780c20591c6ac9000ddcefdfc..a9ed4909a7a1028f58e867d070a9fc55a04597e7 100644 --- a/libavcodec/common.h +++ b/libavcodec/common.h @@ -1156,21 +1156,23 @@ static inline long long rdtsc() } #define START_TIMER \ -static uint64_t tsum=0;\ -static int tcount=0;\ -static int tskip_count=0;\ uint64_t tend;\ uint64_t tstart= rdtsc();\ #define STOP_TIMER(id) \ tend= rdtsc();\ -if(tcount<2 || tend - tstart < 8*tsum/tcount){\ - tsum+= tend - tstart;\ - tcount++;\ -}else\ - tskip_count++;\ -if(256*256*256*64%(tcount+tskip_count)==0){\ - fprintf(stderr, "%Ld dezicycles in %s, %d runs, %d skips\n", tsum*10/tcount, id, tcount, tskip_count);\ +{\ + static uint64_t tsum=0;\ + static int tcount=0;\ + static int tskip_count=0;\ + if(tcount<2 || tend - tstart < 8*tsum/tcount){\ + tsum+= tend - tstart;\ + tcount++;\ + }else\ + tskip_count++;\ + if(256*256*256*64%(tcount+tskip_count)==0){\ + av_log(NULL, AV_LOG_DEBUG, "%Ld dezicycles in %s, %d runs, %d skips\n", tsum*10/tcount, id, tcount, tskip_count);\ + }\ } #endif @@ -1180,6 +1182,10 @@ if(256*256*256*64%(tcount+tskip_count)==0){\ #define malloc please_use_av_malloc #define free please_use_av_free #define realloc please_use_av_realloc +#if !(defined(LIBAVFORMAT_BUILD) || defined(_FRAMEHOOK_H)) +#define printf please_use_av_log +#define fprintf please_use_av_log +#endif #define CHECKED_ALLOCZ(p, size)\ {\ diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 06f2b4e7d0aa7e65917757510a4e6dbaf81c1834..adcc87cc95c90501c30a661bfb55a22d4bdb8909 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -403,7 +403,7 @@ static int rv20_decode_picture_header(MpegEncContext *s) s->time= seq; s->pb_time= s->pp_time - (s->last_non_b_time - s->time); if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){ - printf("messed up order, seeking?, skiping current b frame\n"); + av_log(s->avctx, AV_LOG_DEBUG, "messed up order, seeking?, skiping current b frame\n"); return FRAME_SKIPED; } } diff --git a/libavcodec/smc.c b/libavcodec/smc.c index be02b162d8804bd0f4a2357ec6d298334f0d81d4..2f6f3850a2feda44f31ef2b2a187df56cd255ddc 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -36,6 +36,9 @@ #include "avcodec.h" #include "dsputil.h" +#define printf(...) {} //(f)printf() usage is forbidden in libavcodec, use av_log +#define fprintf(...) {} + #define CPAIR 2 #define CQUAD 4 #define COCTET 8 diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index ebd0ad5229b66836b1155de2a090679ce88e3118..b0a8562ad7553b589eb7d2b1bb65e77aa42ae16b 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -36,6 +36,9 @@ #include "avcodec.h" #include "dsputil.h" +#define printf(...) {} //(f)printf() usage is forbidden in libavcodec, use av_log +#define fprintf(...) {} + #include "truemotion1data.h" #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e49ddd07f06f6c3016eac76e1063086d3a3e1cfe..eb4b19eedc97ac07b8797b2ed447db035fd02dbb 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -832,8 +832,10 @@ static void av_log_default_callback(AVCodecContext* avctx, int level, const char if(level>av_log_level) return; +#undef fprintf if(avctx && print_prefix) fprintf(stderr, "[%s @ %p]", avctx->codec ? avctx->codec->name : "?", avctx); +#define fprintf please_use_av_log print_prefix= strstr(fmt, "\n") != NULL; diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index a5c7f450c2661c4417b13620297b9fcaa6106702..ce50e798d7bad3fa5471a3969f666087616b346a 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -45,6 +45,9 @@ #include "avcodec.h" #include "dsputil.h" +#define printf(...) {} //(f)printf() usage is forbidden in libavcodec, use av_log +#define fprintf(...) {} + #define VMD_HEADER_SIZE 0x330 #define PALETTE_COUNT 256 diff --git a/libavformat/framehook.c b/libavformat/framehook.c index b731c8beac2a0a7a30692d7b0549a50b0df60c5f..ee390e4d99166b9743c76b65a9c7190d02f23831 100644 --- a/libavformat/framehook.c +++ b/libavformat/framehook.c @@ -18,8 +18,8 @@ */ #include #include "config.h" -#include "framehook.h" #include "avformat.h" +#include "framehook.h" #ifdef CONFIG_HAVE_DLFCN #include