From d705e4a6bb6d052f4054886511bf0adb518d72c4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 22 Feb 2004 00:31:19 +0000 Subject: (f)printf() is disallowed in libavcodec, compilation will fail now if its used, except that codecs which where added after the printf->av_log change which did ignore av_log() and used prinf are now silent and wont print anything, they should be changed to use av_log, i could do that, but its better if the orginal developer decides which AV_LOG level each message should get Originally committed as revision 2806 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/common.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'libavcodec/common.h') diff --git a/libavcodec/common.h b/libavcodec/common.h index c48f5f1a54..a9ed4909a7 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)\ {\ -- cgit v1.2.3