From: Diego Biurrun Date: Fri, 29 Apr 2011 15:27:01 +0000 (+0200) Subject: Replace some commented-out debug printf() / av_log() messages with av_dlog(). X-Git-Tag: rel20110916_inqubus2.b.0~4^2~148 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=aebb56e1844d61965c97e95534c3ae0da69df028;p=coroid%2Fffmpeg_saccubus.git Replace some commented-out debug printf() / av_log() messages with av_dlog(). Signed-off-by: Michael Niedermayer --- diff --git a/ffplay.c b/ffplay.c index 27dda94e2..fb38c1fb1 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 cc4dee963..cc814091e 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 cfc950d01..bcbe1f112 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 d4a612661..ff71656f7 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 642af9529..39504741d 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 2adba49e3..8ce825489 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 63d65ed97..14880fe75 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 b935e402b..1017d527d 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)