[FFmpeg-cvslog] Replace some commented-out debug printf() / av_log() messages with av_dlog( ).

Diego Biurrun git at videolan.org
Thu Sep 1 01:44:36 CEST 2011


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Fri Apr 29 17:27:01 2011 +0200| [aebb56e1844d61965c97e95534c3ae0da69df028] | committer: Michael Niedermayer

Replace some commented-out debug printf() / av_log() messages with av_dlog().

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aebb56e1844d61965c97e95534c3ae0da69df028
---

 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 27dda94..fb38c1f 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 cc4dee9..cc81409 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 cfc950d..bcbe1f1 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 d4a6126..ff71656 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 642af95..3950474 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 2adba49..8ce8254 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 63d65ed..14880fe 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 b935e40..1017d52 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)



More information about the ffmpeg-cvslog mailing list