From aebb56e1844d61965c97e95534c3ae0da69df028 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 29 Apr 2011 17:27:01 +0200 Subject: [PATCH] Replace some commented-out debug printf() / av_log() messages with av_dlog(). Signed-off-by: Michael Niedermayer --- ffplay.c | 8 +++----- libavcodec/mpegaudioenc.c | 12 ++++-------- libavcodec/mpegvideo_parser.c | 6 ++---- libavcodec/parser.c | 7 +++---- libavdevice/v4l.c | 10 ++-------- libavformat/mpegenc.c | 5 +---- libavformat/rmdec.c | 16 +++++++--------- libavformat/utils.c | 16 +++++++--------- 8 files changed, 29 insertions(+), 51 deletions(-) diff --git a/ffplay.c b/ffplay.c index 27dda94e20..fb38c1fb13 100644 --- a/ffplay.c +++ b/ffplay.c @@ -1958,11 +1958,9 @@ static int synchronize_audio(VideoState *is, short *samples, samples_size = wanted_size; } } -#if 0 - printf("diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n", - diff, avg_diff, samples_size - samples_size1, - is->audio_clock, is->video_clock, is->audio_diff_threshold); -#endif + av_dlog(NULL, "diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n", + diff, avg_diff, samples_size - samples_size1, + is->audio_clock, is->video_clock, is->audio_diff_threshold); } } else { /* too big difference : may be initial PTS errors, so diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c index cc4dee9636..cc814091ec 100644 --- a/libavcodec/mpegaudioenc.c +++ b/libavcodec/mpegaudioenc.c @@ -397,10 +397,8 @@ static void compute_scale_factors(unsigned char scale_code[SBLIMIT], index = 62; /* value 63 is not allowed */ } -#if 0 - printf("%2d:%d in=%x %x %d\n", - j, i, vmax, scale_factor_table[index], index); -#endif + av_dlog(NULL, "%2d:%d in=%x %x %d\n", + j, i, vmax, scale_factor_table[index], index); /* store the scale factor */ assert(index >=0 && index <= 63); sf[i] = index; @@ -468,10 +466,8 @@ static void compute_scale_factors(unsigned char scale_code[SBLIMIT], code = 0; /* kill warning */ } -#if 0 - printf("%d: %2d %2d %2d %d %d -> %d\n", j, - sf[0], sf[1], sf[2], d1, d2, code); -#endif + av_dlog(NULL, "%d: %2d %2d %2d %d %d -> %d\n", j, + sf[0], sf[1], sf[2], d1, d2, code); scale_code[j] = code; sf += 3; } diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index cfc950d017..bcbe1f112d 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -151,10 +151,8 @@ static int mpegvideo_parse(AVCodecParserContext *s, to have the full timing information. The time take by this function should be negligible for uncorrupted streams */ mpegvideo_extract_headers(s, avctx, buf, buf_size); -#if 0 - printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n", - s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict); -#endif + av_dlog(NULL, "pict_type=%d frame_rate=%0.3f repeat_pict=%d\n", + s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict); *poutbuf = buf; *poutbuf_size = buf_size; diff --git a/libavcodec/parser.c b/libavcodec/parser.c index d4a6126611..ff71656f78 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -219,12 +219,11 @@ void av_parser_close(AVCodecParserContext *s) */ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size) { -#if 0 if(pc->overread){ - printf("overread %d, state:%X next:%d index:%d o_index:%d\n", pc->overread, pc->state, next, pc->index, pc->overread_index); - printf("%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]); + av_dlog(pc, "overread %d, state:%X next:%d index:%d o_index:%d\n", + pc->overread, pc->state, next, pc->index, pc->overread_index); + av_dlog(pc, "%X %X %X %X\n", (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]); } -#endif /* Copy overread bytes from last frame into buffer. */ for(; pc->overread>0; pc->overread--){ diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index 642af9529d..39504741d1 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -154,14 +154,8 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) ioctl(video_fd, VIDIOCSAUDIO, &audio); ioctl(video_fd, VIDIOCGPICT, &pict); -#if 0 - printf("v4l: colour=%d hue=%d brightness=%d constrast=%d whiteness=%d\n", - pict.colour, - pict.hue, - pict.brightness, - pict.contrast, - pict.whiteness); -#endif + av_dlog(s1, "v4l: colour=%d hue=%d brightness=%d constrast=%d whiteness=%d\n", + pict.colour, pict.hue, pict.brightness, pict.contrast, pict.whiteness); /* try to choose a suitable video format */ pict.palette = desired_palette; pict.depth= desired_depth; diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 2adba49e38..8ce825489d 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -662,10 +662,7 @@ static int flush_packet(AVFormatContext *ctx, int stream_index, id = stream->id; -#if 0 - printf("packet ID=%2x PTS=%0.3f\n", - id, pts / 90000.0); -#endif + av_dlog(ctx, "packet ID=%2x PTS=%0.3f\n", id, pts / 90000.0); buf_ptr = buffer; diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 63d65ed97e..14880fe755 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -429,15 +429,13 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap) tag = avio_rl32(pb); tag_size = avio_rb32(pb); avio_rb16(pb); -#if 0 - printf("tag=%c%c%c%c (%08x) size=%d\n", - (tag) & 0xff, - (tag >> 8) & 0xff, - (tag >> 16) & 0xff, - (tag >> 24) & 0xff, - tag, - tag_size); -#endif + av_dlog(s, "tag=%c%c%c%c (%08x) size=%d\n", + (tag ) & 0xff, + (tag >> 8) & 0xff, + (tag >> 16) & 0xff, + (tag >> 24) & 0xff, + tag, + tag_size); if (tag_size < 10 && tag != MKTAG('D', 'A', 'T', 'A')) return -1; switch(tag) { diff --git a/libavformat/utils.c b/libavformat/utils.c index b935e402b8..1017d527d8 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2084,22 +2084,20 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset) } update_stream_timings(ic); -#if 0 { int i; AVStream av_unused *st; for(i = 0;i < ic->nb_streams; i++) { st = ic->streams[i]; - printf("%d: start_time: %0.3f duration: %0.3f\n", - i, (double)st->start_time / AV_TIME_BASE, - (double)st->duration / AV_TIME_BASE); + av_dlog(ic, "%d: start_time: %0.3f duration: %0.3f\n", i, + (double) st->start_time / AV_TIME_BASE, + (double) st->duration / AV_TIME_BASE); } - printf("stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n", - (double)ic->start_time / AV_TIME_BASE, - (double)ic->duration / AV_TIME_BASE, - ic->bit_rate / 1000); + av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n", + (double) ic->start_time / AV_TIME_BASE, + (double) ic->duration / AV_TIME_BASE, + ic->bit_rate / 1000); } -#endif } static int has_codec_parameters(AVCodecContext *avctx)