[FFmpeg-devel] [PATCH] Rename dprintf macro to ff_dprintf.

Diego Elio 'Flameeyes' Pettenò flameeyes
Wed Jul 21 16:32:40 CEST 2010


POSIX.1-2008 specifies dprintf() already; while right now it's not
producing trouble, try to steer clear of the name conflict.
---
 libavcodec/ac3enc.c             |    2 +-
 libavcodec/alsdec.c             |   36 +++++++++---------
 libavcodec/dnxhddec.c           |   10 ++--
 libavcodec/dnxhdenc.c           |    8 ++--
 libavcodec/dvbsub_parser.c      |    8 ++--
 libavcodec/dvbsubdec.c          |   16 ++++----
 libavcodec/dvdsubdec.c          |   16 ++++----
 libavcodec/gifdec.c             |   12 +++---
 libavcodec/h261dec.c            |    4 +-
 libavcodec/ituh263dec.c         |    8 ++--
 libavcodec/mjpegdec.c           |    2 +-
 libavcodec/mpeg12.c             |   40 ++++++++++----------
 libavcodec/mpeg12enc.c          |    2 +-
 libavcodec/mpegaudiodec.c       |   22 +++++-----
 libavcodec/mpegaudiodecheader.c |   12 +++---
 libavcodec/mpegaudioenc.c       |    2 +-
 libavcodec/pcm-mpeg.c           |    6 +-
 libavcodec/pgssubdec.c          |   10 ++--
 libavcodec/pngdec.c             |    6 +-
 libavcodec/rv10.c               |   10 ++--
 libavcodec/shorten.c            |    2 +-
 libavcodec/vaapi.c              |    2 +-
 libavcodec/vaapi_h264.c         |    6 +-
 libavcodec/vaapi_mpeg2.c        |    4 +-
 libavcodec/vaapi_mpeg4.c        |    4 +-
 libavcodec/vaapi_vc1.c          |    4 +-
 libavcodec/wma.c                |    8 ++--
 libavcodec/wmaprodec.c          |   32 ++++++++--------
 libavfilter/avfilter.c          |   12 +++---
 libavfilter/internal.h          |    2 +-
 libavformat/asfdec.c            |   14 +++---
 libavformat/avidec.c            |    4 +-
 libavformat/ffmdec.c            |    2 +-
 libavformat/flvdec.c            |    2 +-
 libavformat/http.c              |    6 +-
 libavformat/mmst.c              |   52 +++++++++++++-------------
 libavformat/mov.c               |   80 +++++++++++++++++++-------------------
 libavformat/mpegts.c            |   26 ++++++------
 libavformat/mxf.h               |    2 +-
 libavformat/mxfdec.c            |   24 ++++++------
 libavformat/r3d.c               |   60 ++++++++++++++--------------
 libavformat/rtpdec.c            |    4 +-
 libavformat/rtpenc.c            |    6 +-
 libavformat/rtsp.c              |   14 +++---
 libavutil/internal.h            |    6 +-
 45 files changed, 305 insertions(+), 305 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index edae9a9..c4507c7 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -250,7 +250,7 @@ static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNEL
     exp_strategy[0][ch] = EXP_NEW;
     for(i=1;i<NB_BLOCKS;i++) {
         exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2);
-        dprintf(NULL, "exp_diff=%d\n", exp_diff);
+        ff_dprintf(NULL, "exp_diff=%d\n", exp_diff);
         if (exp_diff > EXP_DIFF_THRESHOLD)
             exp_strategy[i][ch] = EXP_NEW;
         else
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index bbcbb70..0a99e5d 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -249,24 +249,24 @@ static av_cold void dprint_specific_config(ALSDecContext *ctx)
     AVCodecContext *avctx    = ctx->avctx;
     ALSSpecificConfig *sconf = &ctx->sconf;
 
-    dprintf(avctx, "resolution = %i\n",           sconf->resolution);
-    dprintf(avctx, "floating = %i\n",             sconf->floating);
-    dprintf(avctx, "frame_length = %i\n",         sconf->frame_length);
-    dprintf(avctx, "ra_distance = %i\n",          sconf->ra_distance);
-    dprintf(avctx, "ra_flag = %i\n",              sconf->ra_flag);
-    dprintf(avctx, "adapt_order = %i\n",          sconf->adapt_order);
-    dprintf(avctx, "coef_table = %i\n",           sconf->coef_table);
-    dprintf(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
-    dprintf(avctx, "max_order = %i\n",            sconf->max_order);
-    dprintf(avctx, "block_switching = %i\n",      sconf->block_switching);
-    dprintf(avctx, "bgmc = %i\n",                 sconf->bgmc);
-    dprintf(avctx, "sb_part = %i\n",              sconf->sb_part);
-    dprintf(avctx, "joint_stereo = %i\n",         sconf->joint_stereo);
-    dprintf(avctx, "mc_coding = %i\n",            sconf->mc_coding);
-    dprintf(avctx, "chan_config = %i\n",          sconf->chan_config);
-    dprintf(avctx, "chan_sort = %i\n",            sconf->chan_sort);
-    dprintf(avctx, "RLSLMS = %i\n",               sconf->rlslms);
-    dprintf(avctx, "chan_config_info = %i\n",     sconf->chan_config_info);
+    ff_dprintf(avctx, "resolution = %i\n",           sconf->resolution);
+    ff_dprintf(avctx, "floating = %i\n",             sconf->floating);
+    ff_dprintf(avctx, "frame_length = %i\n",         sconf->frame_length);
+    ff_dprintf(avctx, "ra_distance = %i\n",          sconf->ra_distance);
+    ff_dprintf(avctx, "ra_flag = %i\n",              sconf->ra_flag);
+    ff_dprintf(avctx, "adapt_order = %i\n",          sconf->adapt_order);
+    ff_dprintf(avctx, "coef_table = %i\n",           sconf->coef_table);
+    ff_dprintf(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
+    ff_dprintf(avctx, "max_order = %i\n",            sconf->max_order);
+    ff_dprintf(avctx, "block_switching = %i\n",      sconf->block_switching);
+    ff_dprintf(avctx, "bgmc = %i\n",                 sconf->bgmc);
+    ff_dprintf(avctx, "sb_part = %i\n",              sconf->sb_part);
+    ff_dprintf(avctx, "joint_stereo = %i\n",         sconf->joint_stereo);
+    ff_dprintf(avctx, "mc_coding = %i\n",            sconf->mc_coding);
+    ff_dprintf(avctx, "chan_config = %i\n",          sconf->chan_config);
+    ff_dprintf(avctx, "chan_sort = %i\n",            sconf->chan_sort);
+    ff_dprintf(avctx, "RLSLMS = %i\n",               sconf->rlslms);
+    ff_dprintf(avctx, "chan_config_info = %i\n",     sconf->chan_config_info);
 #endif
 }
 
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 8b7c343..17ff0c0 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -105,7 +105,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
     ctx->height = AV_RB16(buf + 0x18);
     ctx->width  = AV_RB16(buf + 0x1a);
 
-    dprintf(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
+    ff_dprintf(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
 
     if (buf[0x21] & 0x40) {
         av_log(ctx->avctx, AV_LOG_ERROR, "10 bit per component\n");
@@ -113,7 +113,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
     }
 
     ctx->cid = AV_RB32(buf + 0x28);
-    dprintf(ctx->avctx, "compression id %d\n", ctx->cid);
+    ff_dprintf(ctx->avctx, "compression id %d\n", ctx->cid);
 
     if (dnxhd_init_vlc(ctx, ctx->cid) < 0)
         return -1;
@@ -126,7 +126,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
     ctx->mb_width = ctx->width>>4;
     ctx->mb_height = buf[0x16d];
 
-    dprintf(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
+    ff_dprintf(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
 
     if ((ctx->height+15)>>4 == ctx->mb_height && ctx->picture.interlaced_frame)
         ctx->height <<= 1;
@@ -139,7 +139,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
 
     for (i = 0; i < ctx->mb_height; i++) {
         ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i<<2));
-        dprintf(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
+        ff_dprintf(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
         if (buf_size < ctx->mb_scan_index[i] + 0x280) {
             av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index\n");
             return -1;
@@ -291,7 +291,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     AVFrame *picture = data;
     int first_field = 1;
 
-    dprintf(avctx, "frame size %d\n", buf_size);
+    ff_dprintf(avctx, "frame size %d\n", buf_size);
 
  decode_coding_unit:
     if (dnxhd_decode_header(ctx, buf, buf_size, first_field) < 0)
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 6b08929..9f732d5 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -552,7 +552,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
             if (bits > ctx->frame_bits)
                 break;
         }
-        //dprintf(ctx->m.avctx, "lambda %d, up %u, down %u, bits %d, frame %d\n",
+        //ff_dprintf(ctx->m.avctx, "lambda %d, up %u, down %u, bits %d, frame %d\n",
         //        lambda, last_higher, last_lower, bits, ctx->frame_bits);
         if (end) {
             if (bits > ctx->frame_bits)
@@ -582,7 +582,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
             down_step = 1<<LAMBDA_FRAC_BITS;
         }
     }
-    //dprintf(ctx->m.avctx, "out lambda %d\n", lambda);
+    //ff_dprintf(ctx->m.avctx, "out lambda %d\n", lambda);
     ctx->lambda = lambda;
     return 0;
 }
@@ -610,7 +610,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
             if (bits > ctx->frame_bits)
                 break;
         }
-        //dprintf(ctx->m.avctx, "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
+        //ff_dprintf(ctx->m.avctx, "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
         //        ctx->m.avctx->frame_number, qscale, bits, ctx->frame_bits, last_higher, last_lower);
         if (bits < ctx->frame_bits) {
             if (qscale == 1)
@@ -640,7 +640,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
                 return -1;
         }
     }
-    //dprintf(ctx->m.avctx, "out qscale %d\n", qscale);
+    //ff_dprintf(ctx->m.avctx, "out qscale %d\n", qscale);
     ctx->qscale = qscale;
     return 0;
 }
diff --git a/libavcodec/dvbsub_parser.c b/libavcodec/dvbsub_parser.c
index c9ccfd0..d8e6d2f 100644
--- a/libavcodec/dvbsub_parser.c
+++ b/libavcodec/dvbsub_parser.c
@@ -55,7 +55,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
     uint8_t *p, *p_end;
     int len, buf_pos = 0;
 
-    dprintf(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
+    ff_dprintf(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
             s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
 
 #ifdef DEBUG_PACKET_CONTENTS
@@ -82,7 +82,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
     {
         if (pc->packet_index != pc->packet_start)
         {
-            dprintf(avctx, "Discarding %d bytes\n",
+            ff_dprintf(avctx, "Discarding %d bytes\n",
                     pc->packet_index - pc->packet_start);
         }
 
@@ -90,7 +90,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
         pc->packet_index = 0;
 
         if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) {
-            dprintf(avctx, "Bad packet header\n");
+            ff_dprintf(avctx, "Bad packet header\n");
             return -1;
         }
 
@@ -147,7 +147,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
         } else if (*p == 0xff) {
             if (p + 1 < p_end)
             {
-                dprintf(avctx, "Junk at end of packet\n");
+                ff_dprintf(avctx, "Junk at end of packet\n");
             }
             pc->packet_index = p - pc->packet_buf;
             pc->in_packet = 0;
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 3e06260..b7dda2d 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -749,7 +749,7 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
                          0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
     uint8_t *map_table;
 
-    dprintf(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
+    ff_dprintf(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
             top_bottom ? "bottom" : "top");
 
 #ifdef DEBUG_PACKET_CONTENTS
@@ -984,7 +984,7 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
         YUV_TO_RGB1_CCIR(cb, cr);
         YUV_TO_RGB2_CCIR(r, g, b, y);
 
-        dprintf(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
+        ff_dprintf(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
 
         if (depth & 0x80)
             clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
@@ -1060,11 +1060,11 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
             region->bgcolor = (((*buf++) >> 2) & 3);
     }
 
-    dprintf(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
+    ff_dprintf(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
 
     if (fill) {
         memset(region->pbuf, region->bgcolor, region->buf_size);
-        dprintf(avctx, "Fill region (%d)\n", region->bgcolor);
+        ff_dprintf(avctx, "Fill region (%d)\n", region->bgcolor);
     }
 
     delete_region_display_list(ctx, region);
@@ -1125,7 +1125,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
     ctx->time_out = *buf++;
     page_state = ((*buf++) >> 2) & 3;
 
-    dprintf(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
+    ff_dprintf(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
 
     if (page_state == 2) {
         delete_state(ctx);
@@ -1163,7 +1163,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
         ctx->display_list = display;
         ctx->display_list_size++;
 
-        dprintf(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
+        ff_dprintf(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
     }
 
     while (tmp_display_list) {
@@ -1461,7 +1461,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
                 *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
                 break;
             default:
-                dprintf(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
+                ff_dprintf(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
                         segment_type, page_id, segment_length);
                 break;
             }
@@ -1471,7 +1471,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
     }
 
     if (p != p_end) {
-        dprintf(avctx, "Junk at end of packet\n");
+        ff_dprintf(avctx, "Junk at end of packet\n");
         return -1;
     }
 
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 98b766e..234e7c8 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -190,7 +190,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
     while (cmd_pos > 0 && cmd_pos < buf_size - 2 - offset_size) {
         date = AV_RB16(buf + cmd_pos);
         next_cmd_pos = READ_OFFSET(buf + cmd_pos + 2);
-        dprintf(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
+        ff_dprintf(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
                 cmd_pos, next_cmd_pos, date);
         pos = cmd_pos + 2 + offset_size;
         offset1 = -1;
@@ -198,7 +198,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
         x1 = y1 = x2 = y2 = 0;
         while (pos < buf_size) {
             cmd = buf[pos++];
-            dprintf(NULL, "cmd=%02x\n", cmd);
+            ff_dprintf(NULL, "cmd=%02x\n", cmd);
             switch(cmd) {
             case 0x00:
                 /* menu subpicture */
@@ -231,7 +231,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                 alpha[1] = buf[pos + 1] >> 4;
                 alpha[0] = buf[pos + 1] & 0x0f;
                 pos += 2;
-            dprintf(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
+            ff_dprintf(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
                 break;
             case 0x05:
             case 0x85:
@@ -243,7 +243,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                 y2 = ((buf[pos + 4] & 0x0f) << 8) | buf[pos + 5];
                 if (cmd & 0x80)
                     is_8bit = 1;
-                dprintf(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
+                ff_dprintf(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
                 pos += 6;
                 break;
             case 0x06:
@@ -251,7 +251,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                     goto fail;
                 offset1 = AV_RB16(buf + pos);
                 offset2 = AV_RB16(buf + pos + 2);
-                dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
+                ff_dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
                 pos += 4;
                 break;
             case 0x86:
@@ -259,7 +259,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                     goto fail;
                 offset1 = AV_RB32(buf + pos);
                 offset2 = AV_RB32(buf + pos + 4);
-                dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
+                ff_dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
                 pos += 8;
                 break;
 
@@ -282,7 +282,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
             case 0xff:
                 goto the_end;
             default:
-                dprintf(NULL, "unrecognised subpicture command 0x%x\n", cmd);
+                ff_dprintf(NULL, "unrecognised subpicture command 0x%x\n", cmd);
                 goto the_end;
             }
         }
@@ -475,7 +475,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
         goto no_subtitle;
 
 #if defined(DEBUG)
-    dprintf(NULL, "start=%d ms end =%d ms\n",
+    ff_dprintf(NULL, "start=%d ms end =%d ms\n",
             sub->start_display_time,
             sub->end_display_time);
     ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0],
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 1daf1b7..1fb4abb 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -76,7 +76,7 @@ static int gif_read_image(GifState *s)
     has_local_palette = flags & 0x80;
     bits_per_pixel = (flags & 0x07) + 1;
 #ifdef DEBUG
-    dprintf(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
+    ff_dprintf(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
 #endif
 
     if (has_local_palette) {
@@ -163,7 +163,7 @@ static int gif_read_extension(GifState *s)
     ext_code = bytestream_get_byte(&s->bytestream);
     ext_len = bytestream_get_byte(&s->bytestream);
 #ifdef DEBUG
-    dprintf(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
+    ff_dprintf(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
 #endif
     switch(ext_code) {
     case 0xf9:
@@ -179,7 +179,7 @@ static int gif_read_extension(GifState *s)
             s->transparent_color_index = -1;
         s->gce_disposal = (gce_flags >> 2) & 0x7;
 #ifdef DEBUG
-        dprintf(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
+        ff_dprintf(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
                gce_flags, s->gce_delay,
                s->transparent_color_index, s->gce_disposal);
 #endif
@@ -194,7 +194,7 @@ static int gif_read_extension(GifState *s)
             bytestream_get_byte(&s->bytestream);
         ext_len = bytestream_get_byte(&s->bytestream);
 #ifdef DEBUG
-        dprintf(s->avctx, "gif: ext_len1=%d\n", ext_len);
+        ff_dprintf(s->avctx, "gif: ext_len1=%d\n", ext_len);
 #endif
     }
     return 0;
@@ -232,7 +232,7 @@ static int gif_read_header1(GifState *s)
     s->background_color_index = bytestream_get_byte(&s->bytestream);
     bytestream_get_byte(&s->bytestream);                /* ignored */
 #ifdef DEBUG
-    dprintf(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
+    ff_dprintf(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
            s->screen_width, s->screen_height, s->bits_per_pixel,
            has_global_palette);
 #endif
@@ -250,7 +250,7 @@ static int gif_parse_next_image(GifState *s)
     while (s->bytestream < s->bytestream_end) {
         int code = bytestream_get_byte(&s->bytestream);
 #ifdef DEBUG
-        dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code);
+        ff_dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code);
 #endif
         switch (code) {
         case ',':
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 3809a01..74551f2 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -553,8 +553,8 @@ static int h261_decode_frame(AVCodecContext *avctx,
     int ret;
     AVFrame *pict = data;
 
-    dprintf(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
-    dprintf(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
+    ff_dprintf(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
+    ff_dprintf(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
     s->flags= avctx->flags;
     s->flags2= avctx->flags2;
 
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 8b5d939..5aebba3 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -325,7 +325,7 @@ static int h263p_decode_umotion(MpegEncContext * s, int pred)
    code >>= 1;
 
    code = (sign) ? (pred - code) : (pred + code);
-   dprintf(s->avctx,"H.263+ UMV Motion = %d\n", code);
+   ff_dprintf(s->avctx,"H.263+ UMV Motion = %d\n", code);
    return code;
 
 }
@@ -951,7 +951,7 @@ int h263_decode_picture_header(MpegEncContext *s)
         if (ufep == 1) {
             /* OPPTYPE */
             format = get_bits(&s->gb, 3);
-            dprintf(s->avctx, "ufep=1, format: %d\n", format);
+            ff_dprintf(s->avctx, "ufep=1, format: %d\n", format);
             s->custom_pcf= get_bits1(&s->gb);
             s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */
             if (get_bits1(&s->gb) != 0) {
@@ -1002,7 +1002,7 @@ int h263_decode_picture_header(MpegEncContext *s)
             if (format == 6) {
                 /* Custom Picture Format (CPFMT) */
                 s->aspect_ratio_info = get_bits(&s->gb, 4);
-                dprintf(s->avctx, "aspect: %d\n", s->aspect_ratio_info);
+                ff_dprintf(s->avctx, "aspect: %d\n", s->aspect_ratio_info);
                 /* aspect ratios:
                 0 - forbidden
                 1 - 1:1
@@ -1015,7 +1015,7 @@ int h263_decode_picture_header(MpegEncContext *s)
                 width = (get_bits(&s->gb, 9) + 1) * 4;
                 skip_bits1(&s->gb);
                 height = get_bits(&s->gb, 9) * 4;
-                dprintf(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
+                ff_dprintf(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
                 if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
                     /* aspected dimensions */
                     s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8);
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 8aff966..c9739f2 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1250,7 +1250,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
     }
     val = -1;
 found:
-    dprintf(NULL, "find_marker skipped %d bytes\n", skipped);
+    ff_dprintf(NULL, "find_marker skipped %d bytes\n", skipped);
     *pbuf_ptr = buf_ptr;
     return val;
 }
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 0af24ad..03f11b1 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -210,7 +210,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
     int i, j, k, cbp, val, mb_type, motion_type;
     const int mb_block_count = 4 + (1<< s->chroma_format);
 
-    dprintf(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
+    ff_dprintf(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
 
     assert(s->mb_skipped==0);
 
@@ -269,7 +269,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
         mb_type = btype2mb_type[ mb_type ];
         break;
     }
-    dprintf(s->avctx, "mb_type=%x\n", mb_type);
+    ff_dprintf(s->avctx, "mb_type=%x\n", mb_type);
 //    motion_type = 0; /* avoid warning */
     if (IS_INTRA(mb_type)) {
         s->dsp.clear_blocks(s->block[0]);
@@ -367,7 +367,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
 
             /* motion vectors */
             s->mv_dir= (mb_type>>13)&3;
-            dprintf(s->avctx, "motion_type=%d\n", motion_type);
+            ff_dprintf(s->avctx, "motion_type=%d\n", motion_type);
             switch(motion_type) {
             case MT_FRAME: /* or MT_16X8 */
                 if (s->picture_structure == PICT_FRAME) {
@@ -418,12 +418,12 @@ static int mpeg_decode_mb(MpegEncContext *s,
                                                          s->last_mv[i][j][0]);
                                 s->last_mv[i][j][0] = val;
                                 s->mv[i][j][0] = val;
-                                dprintf(s->avctx, "fmx=%d\n", val);
+                                ff_dprintf(s->avctx, "fmx=%d\n", val);
                                 val = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
                                                          s->last_mv[i][j][1] >> 1);
                                 s->last_mv[i][j][1] = val << 1;
                                 s->mv[i][j][1] = val;
-                                dprintf(s->avctx, "fmy=%d\n", val);
+                                ff_dprintf(s->avctx, "fmy=%d\n", val);
                             }
                         }
                     }
@@ -629,7 +629,7 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s,
     dc += diff;
     s->last_dc[component] = dc;
     block[0] = dc*quant_matrix[0];
-    dprintf(s->avctx, "dc=%d diff=%d\n", dc, diff);
+    ff_dprintf(s->avctx, "dc=%d diff=%d\n", dc, diff);
     i = 0;
     {
         OPEN_READER(re, &s->gb);
@@ -1041,7 +1041,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
     dc += diff;
     s->last_dc[component] = dc;
     block[0] = dc << (3 - s->intra_dc_precision);
-    dprintf(s->avctx, "dc=%d\n", block[0]);
+    ff_dprintf(s->avctx, "dc=%d\n", block[0]);
     mismatch = block[0] ^ 1;
     i = 0;
     if (s->intra_vlc_format)
@@ -1415,7 +1415,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
     s1->frame_rate_ext.num = get_bits(&s->gb, 2)+1;
     s1->frame_rate_ext.den = get_bits(&s->gb, 5)+1;
 
-    dprintf(s->avctx, "sequence extension\n");
+    ff_dprintf(s->avctx, "sequence extension\n");
     s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO;
     s->avctx->sub_id = 2; /* indicates MPEG-2 found */
 
@@ -1506,7 +1506,7 @@ static int load_matrix(MpegEncContext *s, uint16_t matrix0[64], uint16_t matrix1
 
 static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)
 {
-    dprintf(s->avctx, "matrix extension\n");
+    ff_dprintf(s->avctx, "matrix extension\n");
 
     if(get_bits1(&s->gb)) load_matrix(s, s->chroma_intra_matrix, s->intra_matrix, 1);
     if(get_bits1(&s->gb)) load_matrix(s, s->chroma_inter_matrix, s->inter_matrix, 0);
@@ -1580,15 +1580,15 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
     }
 
     /* composite display not parsed */
-    dprintf(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);
-    dprintf(s->avctx, "picture_structure=%d\n", s->picture_structure);
-    dprintf(s->avctx, "top field first=%d\n", s->top_field_first);
-    dprintf(s->avctx, "repeat first field=%d\n", s->repeat_first_field);
-    dprintf(s->avctx, "conceal=%d\n", s->concealment_motion_vectors);
-    dprintf(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format);
-    dprintf(s->avctx, "alternate_scan=%d\n", s->alternate_scan);
-    dprintf(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
-    dprintf(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
+    ff_dprintf(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);
+    ff_dprintf(s->avctx, "picture_structure=%d\n", s->picture_structure);
+    ff_dprintf(s->avctx, "top field first=%d\n", s->top_field_first);
+    ff_dprintf(s->avctx, "repeat first field=%d\n", s->repeat_first_field);
+    ff_dprintf(s->avctx, "conceal=%d\n", s->concealment_motion_vectors);
+    ff_dprintf(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format);
+    ff_dprintf(s->avctx, "alternate_scan=%d\n", s->alternate_scan);
+    ff_dprintf(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
+    ff_dprintf(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
 }
 
 static void exchange_uv(MpegEncContext *s){
@@ -2229,7 +2229,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
     Mpeg1Context *s = avctx->priv_data;
     AVFrame *picture = data;
     MpegEncContext *s2 = &s->mpeg_enc_ctx;
-    dprintf(avctx, "fill_buffer\n");
+    ff_dprintf(avctx, "fill_buffer\n");
 
     if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
         /* special case for last picture */
@@ -2553,7 +2553,7 @@ static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){
     if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
         return -1;
     if( !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD) ){
-        dprintf(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
+        ff_dprintf(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
     }
     mpeg_decode_init(avctx);
 
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 6868e2a..e29fe31 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -890,7 +890,7 @@ static void mpeg1_encode_block(MpegEncContext *s,
     next_coef:
 #if 0
         if (level != 0)
-            dprintf(s->avctx, "level[%d]=%d\n", i, level);
+            ff_dprintf(s->avctx, "level[%d]=%d\n", i, level);
 #endif
         /* encode using VLC */
         if (level != 0) {
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 4f48c15..2f31e10 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -352,7 +352,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
             scale_factor_mult[i][0] = MULLx(norm, FIXR(1.0          * 2.0), FRAC_BITS);
             scale_factor_mult[i][1] = MULLx(norm, FIXR(0.7937005259 * 2.0), FRAC_BITS);
             scale_factor_mult[i][2] = MULLx(norm, FIXR(0.6299605249 * 2.0), FRAC_BITS);
-            dprintf(avctx, "%d: norm=%x s=%x %x %x\n",
+            ff_dprintf(avctx, "%d: norm=%x s=%x %x %x\n",
                     i, norm,
                     scale_factor_mult[i][0],
                     scale_factor_mult[i][1],
@@ -457,7 +457,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
                 k = i & 1;
                 is_table_lsf[j][k ^ 1][i] = FIXR(f);
                 is_table_lsf[j][k][i] = FIXR(1.0);
-                dprintf(avctx, "is_table_lsf %d %d: %x %x\n",
+                ff_dprintf(avctx, "is_table_lsf %d %d: %x %x\n",
                         i, j, is_table_lsf[j][0][i], is_table_lsf[j][1][i]);
             }
         }
@@ -986,7 +986,7 @@ static int mp_decode_layer2(MPADecodeContext *s)
     else
         bound = sblimit;
 
-    dprintf(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
+    ff_dprintf(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
 
     /* sanity check */
     if( bound > sblimit ) bound = sblimit;
@@ -1309,7 +1309,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
 
             exponent= exponents[s_index];
 
-            dprintf(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
+            ff_dprintf(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
                     i, g->region_size[i] - j, x, y, exponent);
             if(y&16){
                 x = y >> 5;
@@ -1377,7 +1377,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
         last_pos= pos;
 
         code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
-        dprintf(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
+        ff_dprintf(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
         g->sb_hybrid[s_index+0]=
         g->sb_hybrid[s_index+1]=
         g->sb_hybrid[s_index+2]=
@@ -1735,7 +1735,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
 
     for(gr=0;gr<nb_granules;gr++) {
         for(ch=0;ch<s->nb_channels;ch++) {
-            dprintf(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
+            ff_dprintf(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
             g = &s->granules[ch][gr];
             g->part2_3_length = get_bits(&s->gb, 12);
             g->big_values = get_bits(&s->gb, 9);
@@ -1776,7 +1776,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
                 /* compute huffman coded region sizes */
                 region_address1 = get_bits(&s->gb, 4);
                 region_address2 = get_bits(&s->gb, 3);
-                dprintf(s->avctx, "region1=%d region2=%d\n",
+                ff_dprintf(s->avctx, "region1=%d region2=%d\n",
                         region_address1, region_address2);
                 ff_init_long_region(s, g, region_address1, region_address2);
             }
@@ -1788,7 +1788,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
                 g->preflag = get_bits1(&s->gb);
             g->scalefac_scale = get_bits1(&s->gb);
             g->count1table_select = get_bits1(&s->gb);
-            dprintf(s->avctx, "block_type=%d switch_point=%d\n",
+            ff_dprintf(s->avctx, "block_type=%d switch_point=%d\n",
                     g->block_type, g->switch_point);
         }
     }
@@ -1797,7 +1797,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
     const uint8_t *ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);
     assert((get_bits_count(&s->gb) & 7) == 0);
     /* now we get bits from the main_data_begin offset */
-    dprintf(s->avctx, "seekback: %d\n", main_data_begin);
+    ff_dprintf(s->avctx, "seekback: %d\n", main_data_begin);
 //av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size);
 
     memcpy(s->last_buf + s->last_buf_size, ptr, EXTRABYTES);
@@ -1831,7 +1831,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
                 /* MPEG1 scale factors */
                 slen1 = slen_table[0][g->scalefac_compress];
                 slen2 = slen_table[1][g->scalefac_compress];
-                dprintf(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
+                ff_dprintf(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
                 if (g->block_type == 2) {
                     n = g->switch_point ? 17 : 18;
                     j = 0;
@@ -1964,7 +1964,7 @@ static int mp_decode_frame(MPADecodeContext *s,
     if (s->error_protection)
         skip_bits(&s->gb, 16);
 
-    dprintf(s->avctx, "frame %d:\n", s->frame_count);
+    ff_dprintf(s->avctx, "frame %d:\n", s->frame_count);
     switch(s->layer) {
     case 1:
         s->avctx->frame_size = 384;
diff --git a/libavcodec/mpegaudiodecheader.c b/libavcodec/mpegaudiodecheader.c
index 67f882f..66da7de 100644
--- a/libavcodec/mpegaudiodecheader.c
+++ b/libavcodec/mpegaudiodecheader.c
@@ -91,20 +91,20 @@ int ff_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
     }
 
 #if defined(DEBUG)
-    dprintf(NULL, "layer%d, %d Hz, %d kbits/s, ",
+    ff_dprintf(NULL, "layer%d, %d Hz, %d kbits/s, ",
            s->layer, s->sample_rate, s->bit_rate);
     if (s->nb_channels == 2) {
         if (s->layer == 3) {
             if (s->mode_ext & MODE_EXT_MS_STEREO)
-                dprintf(NULL, "ms-");
+                ff_dprintf(NULL, "ms-");
             if (s->mode_ext & MODE_EXT_I_STEREO)
-                dprintf(NULL, "i-");
+                ff_dprintf(NULL, "i-");
         }
-        dprintf(NULL, "stereo");
+        ff_dprintf(NULL, "stereo");
     } else {
-        dprintf(NULL, "mono");
+        ff_dprintf(NULL, "mono");
     }
-    dprintf(NULL, "\n");
+    ff_dprintf(NULL, "\n");
 #endif
     return 0;
 }
diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c
index ce1524b..08c909a 100644
--- a/libavcodec/mpegaudioenc.c
+++ b/libavcodec/mpegaudioenc.c
@@ -122,7 +122,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
     s->sblimit = ff_mpa_sblimit_table[table];
     s->alloc_table = ff_mpa_alloc_tables[table];
 
-    dprintf(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
+    ff_dprintf(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
             bitrate, freq, s->frame_size, table, s->frame_frac_incr);
 
     for(i=0;i<s->nb_channels;i++)
diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c
index c2343a6..bd51a37 100644
--- a/libavcodec/pcm-mpeg.c
+++ b/libavcodec/pcm-mpeg.c
@@ -63,7 +63,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
     uint8_t channel_layout = header[2] >> 4;
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
-        dprintf(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
+        ff_dprintf(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
                 header[0], header[1], header[2], header[3]);
 
     /* get the sample depth and derive the sample format from it */
@@ -111,7 +111,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
                       avctx->bits_per_coded_sample;
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
-        dprintf(avctx,
+        ff_dprintf(avctx,
                 "pcm_bluray_parse_header: %d channels, %d bits per sample, %d kHz, %d kbit\n",
                 avctx->channels, avctx->bits_per_coded_sample,
                 avctx->sample_rate, avctx->bit_rate);
@@ -290,7 +290,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx,
 
     retval = src - avpkt->data;
     if (avctx->debug & FF_DEBUG_BITSTREAM)
-        dprintf(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
+        ff_dprintf(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
                 retval, *data_size);
     return retval;
 }
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index bda7665..0518618 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -135,7 +135,7 @@ static int decode_rle(AVCodecContext *avctx, AVSubtitle *sub,
         }
     }
 
-    dprintf(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, sub->rects[0]->w * sub->rects[0]->h);
+    ff_dprintf(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, sub->rects[0]->w * sub->rects[0]->h);
 
     return 0;
 }
@@ -238,7 +238,7 @@ static void parse_palette_segment(AVCodecContext *avctx,
         YUV_TO_RGB1(cb, cr);
         YUV_TO_RGB2(r, g, b, y);
 
-        dprintf(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
+        ff_dprintf(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
 
         /* Store color in palette */
         ctx->clut[color_id] = RGBA(r,g,b,alpha);
@@ -269,7 +269,7 @@ static void parse_presentation_segment(AVCodecContext *avctx,
     ctx->presentation.video_w = bytestream_get_be16(&buf);
     ctx->presentation.video_h = bytestream_get_be16(&buf);
 
-    dprintf(avctx, "Video Dimensions %dx%d\n",
+    ff_dprintf(avctx, "Video Dimensions %dx%d\n",
             ctx->presentation.video_w, ctx->presentation.video_h);
 
     /* Skip 1 bytes of unknown, frame rate? */
@@ -296,7 +296,7 @@ static void parse_presentation_segment(AVCodecContext *avctx,
 
         /* TODO If cropping, cropping_x, cropping_y, cropping_width, cropping_height (all 2 bytes).*/
 
-        dprintf(avctx, "Subtitle Placement x=%d, y=%d\n", x, y);
+        ff_dprintf(avctx, "Subtitle Placement x=%d, y=%d\n", x, y);
 
         if (x > ctx->presentation.video_w || y > ctx->presentation.video_h) {
             av_log(avctx, AV_LOG_ERROR, "Subtitle out of video bounds. x = %d, y = %d, video width = %d, video height = %d.\n",
@@ -412,7 +412,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
         segment_type   = bytestream_get_byte(&buf);
         segment_length = bytestream_get_be16(&buf);
 
-        dprintf(avctx, "Segment Length %d, Segment Type %x\n", segment_length, segment_type);
+        ff_dprintf(avctx, "Segment Length %d, Segment Type %x\n", segment_length, segment_type);
 
         if (segment_type != DISPLAY_SEGMENT && segment_length > buf_end - buf)
             break;
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 037c5a0..b8e584a 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -430,7 +430,7 @@ static int decode_frame(AVCodecContext *avctx,
             goto fail;
         tag32 = bytestream_get_be32(&s->bytestream);
         tag = av_bswap32(tag32);
-        dprintf(avctx, "png: tag=%c%c%c%c length=%u\n",
+        ff_dprintf(avctx, "png: tag=%c%c%c%c length=%u\n",
                 (tag & 0xff),
                 ((tag >> 8) & 0xff),
                 ((tag >> 16) & 0xff),
@@ -452,7 +452,7 @@ static int decode_frame(AVCodecContext *avctx,
             s->interlace_type = *s->bytestream++;
             crc = bytestream_get_be32(&s->bytestream);
             s->state |= PNG_IHDR;
-            dprintf(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
+            ff_dprintf(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
                     s->width, s->height, s->bit_depth, s->color_type,
                     s->compression_type, s->filter_type, s->interlace_type);
             break;
@@ -516,7 +516,7 @@ static int decode_frame(AVCodecContext *avctx,
                                                          s->width);
                     s->crow_size = s->pass_row_size + 1;
                 }
-                dprintf(avctx, "row_size=%d crow_size =%d\n",
+                ff_dprintf(avctx, "row_size=%d crow_size =%d\n",
                         s->row_size, s->crow_size);
                 s->image_buf = p->data[0];
                 s->image_linesize = p->linesize[0];
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index e9face6..af1da26 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -245,7 +245,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
     if(!marker) av_log(s->avctx, AV_LOG_ERROR, "marker missing\n");
     pb_frame = get_bits1(&s->gb);
 
-    dprintf(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
+    ff_dprintf(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
 
     if (pb_frame){
         av_log(s->avctx, AV_LOG_ERROR, "pb frame not supported\n");
@@ -264,7 +264,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
             s->last_dc[0] = get_bits(&s->gb, 8);
             s->last_dc[1] = get_bits(&s->gb, 8);
             s->last_dc[2] = get_bits(&s->gb, 8);
-            dprintf(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
+            ff_dprintf(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
                     s->last_dc[1], s->last_dc[2]);
         }
     }
@@ -560,7 +560,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
         ff_er_frame_start(s);
     }
 
-    dprintf(avctx, "qscale=%d\n", s->qscale);
+    ff_dprintf(avctx, "qscale=%d\n", s->qscale);
 
     /* default quantization values */
     if(s->codec_id== CODEC_ID_RV10){
@@ -599,7 +599,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
     for(s->mb_num_left= mb_count; s->mb_num_left>0; s->mb_num_left--) {
         int ret;
         ff_update_block_index(s);
-        dprintf(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
+        ff_dprintf(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
 
         s->mv_dir = MV_DIR_FORWARD;
         s->mv_type = MV_TYPE_16X16;
@@ -654,7 +654,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
     int slice_count;
     const uint8_t *slices_hdr = NULL;
 
-    dprintf(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
+    ff_dprintf(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
 
     /* no supplementary picture */
     if (buf_size == 0) {
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 213e5b3..ccc65f5 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -305,7 +305,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
         s->bitstream_size= buf_size;
 
         if(buf_size < s->max_framesize){
-            //dprintf(avctx, "wanna more data ... %d\n", buf_size);
+            //ff_dprintf(avctx, "wanna more data ... %d\n", buf_size);
             *data_size = 0;
             return input_buf_size;
         }
diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index 10f9054..3f9c542 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -180,7 +180,7 @@ int ff_vaapi_common_end_frame(MpegEncContext *s)
     struct vaapi_context * const vactx = s->avctx->hwaccel_context;
     int ret = -1;
 
-    dprintf(s->avctx, "ff_vaapi_common_end_frame()\n");
+    ff_dprintf(s->avctx, "ff_vaapi_common_end_frame()\n");
 
     if (commit_slices(vactx) < 0)
         goto done;
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index 29f3a81..5803409 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -227,7 +227,7 @@ static int start_frame(AVCodecContext          *avctx,
     VAPictureParameterBufferH264 *pic_param;
     VAIQMatrixBufferH264 *iq_matrix;
 
-    dprintf(avctx, "start_frame()\n");
+    ff_dprintf(avctx, "start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferH264);
 
@@ -289,7 +289,7 @@ static int end_frame(AVCodecContext *avctx)
 {
     H264Context * const h = avctx->priv_data;
 
-    dprintf(avctx, "end_frame()\n");
+    ff_dprintf(avctx, "end_frame()\n");
     return ff_vaapi_common_end_frame(&h->s);
 }
 
@@ -302,7 +302,7 @@ static int decode_slice(AVCodecContext *avctx,
     MpegEncContext * const s = &h->s;
     VASliceParameterBufferH264 *slice_param;
 
-    dprintf(avctx, "decode_slice(): buffer %p, size %d\n", buffer, size);
+    ff_dprintf(avctx, "decode_slice(): buffer %p, size %d\n", buffer, size);
 
     /* Fill in VASliceParameterBufferH264. */
     slice_param = (VASliceParameterBufferH264 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
index 2e870dc..ba6240b 100644
--- a/libavcodec/vaapi_mpeg2.c
+++ b/libavcodec/vaapi_mpeg2.c
@@ -44,7 +44,7 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
     VAIQMatrixBufferMPEG2 *iq_matrix;
     int i;
 
-    dprintf(avctx, "vaapi_mpeg2_start_frame()\n");
+    ff_dprintf(avctx, "vaapi_mpeg2_start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG2);
 
@@ -111,7 +111,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
     GetBitContext gb;
     uint32_t start_code, quantiser_scale_code, intra_slice_flag, macroblock_offset;
 
-    dprintf(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
+    ff_dprintf(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
 
     /* Determine macroblock_offset */
     init_get_bits(&gb, buffer, 8 * size);
diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
index 8f02e91..4646d35 100644
--- a/libavcodec/vaapi_mpeg4.c
+++ b/libavcodec/vaapi_mpeg4.c
@@ -47,7 +47,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
     VAIQMatrixBufferMPEG4 *iq_matrix;
     int i;
 
-    dprintf(avctx, "vaapi_mpeg4_start_frame()\n");
+    ff_dprintf(avctx, "vaapi_mpeg4_start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG4);
 
@@ -125,7 +125,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
     MpegEncContext * const s = avctx->priv_data;
     VASliceParameterBufferMPEG4 *slice_param;
 
-    dprintf(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
+    ff_dprintf(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
 
     /* video_plane_with_short_video_header() contains all GOBs
      * in-order, and this is what VA API (Intel backend) expects: only
diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
index 2c24042..d12831b 100644
--- a/libavcodec/vaapi_vc1.c
+++ b/libavcodec/vaapi_vc1.c
@@ -138,7 +138,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
     struct vaapi_context * const vactx = avctx->hwaccel_context;
     VAPictureParameterBufferVC1 *pic_param;
 
-    dprintf(avctx, "vaapi_vc1_start_frame()\n");
+    ff_dprintf(avctx, "vaapi_vc1_start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferVC1);
 
@@ -308,7 +308,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
     MpegEncContext * const s = &v->s;
     VASliceParameterBufferVC1 *slice_param;
 
-    dprintf(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
+    ff_dprintf(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
 
     /* Current bit buffer is beyond any marker for VC-1, so skip it */
     if (avctx->codec_id == CODEC_ID_VC1 && IS_MARKER(AV_RB32(buffer))) {
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index e2d153b..62872b7 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -217,13 +217,13 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
             high_freq = high_freq * 0.5;
         }
     }
-    dprintf(s->avctx, "flags2=0x%x\n", flags2);
-    dprintf(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
+    ff_dprintf(s->avctx, "flags2=0x%x\n", flags2);
+    ff_dprintf(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
             s->version, s->nb_channels, s->sample_rate, s->bit_rate,
             s->block_align);
-    dprintf(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
+    ff_dprintf(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
             bps, bps1, high_freq, s->byte_offset_bits);
-    dprintf(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
+    ff_dprintf(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
             s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes);
 
     /* compute the scale factor band sizes for each MDCT block size */
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 3eca101..c6f6794 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -284,8 +284,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
         s->bits_per_sample = AV_RL16(edata_ptr);
         /** dump the extradata */
         for (i = 0; i < avctx->extradata_size; i++)
-            dprintf(avctx, "[%x] ", avctx->extradata[i]);
-        dprintf(avctx, "\n");
+            ff_dprintf(avctx, "[%x] ", avctx->extradata[i]);
+        ff_dprintf(avctx, "\n");
 
     } else {
         av_log_ask_for_sample(avctx, "Unknown extradata size\n");
@@ -583,7 +583,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
         int i;
         int offset = 0;
         for (i = 0; i < s->channel[c].num_subframes; i++) {
-            dprintf(s->avctx, "frame[%i] channel[%i] subframe[%i]"
+            ff_dprintf(s->avctx, "frame[%i] channel[%i] subframe[%i]"
                     " len %i\n", s->frame_num, c, i,
                     s->channel[c].subframe_len[i]);
             s->channel[c].subframe_offset[i] = offset;
@@ -782,7 +782,7 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
     const uint16_t* run;
     const float* level;
 
-    dprintf(s->avctx, "decode coefficients for channel %i\n", c);
+    ff_dprintf(s->avctx, "decode coefficients for channel %i\n", c);
 
     vlctable = get_bits1(&s->gb);
     vlc = &coef_vlc[vlctable];
@@ -1066,7 +1066,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
         }
     }
 
-    dprintf(s->avctx,
+    ff_dprintf(s->avctx,
             "processing subframe with offset %i len %i\n", offset, subframe_len);
 
     /** get a list of all channels that contain the estimated block */
@@ -1093,7 +1093,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
         s->parsed_all_subframes = 1;
 
 
-    dprintf(s->avctx, "subframe is part of %i channels\n",
+    ff_dprintf(s->avctx, "subframe is part of %i channels\n",
             s->channels_for_cur_subframe);
 
     /** calculate number of scale factor bands and their offsets */
@@ -1195,7 +1195,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
             return AVERROR_INVALIDDATA;
     }
 
-    dprintf(s->avctx, "BITSTREAM: subframe header length was %i\n",
+    ff_dprintf(s->avctx, "BITSTREAM: subframe header length was %i\n",
             get_bits_count(&s->gb) - s->subframe_offset);
 
     /** parse coefficients */
@@ -1209,7 +1209,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
                    sizeof(*s->channel[c].coeffs) * subframe_len);
     }
 
-    dprintf(s->avctx, "BITSTREAM: subframe length was %i\n",
+    ff_dprintf(s->avctx, "BITSTREAM: subframe length was %i\n",
             get_bits_count(&s->gb) - s->subframe_offset);
 
     if (transmit_coeffs) {
@@ -1285,7 +1285,7 @@ static int decode_frame(WMAProDecodeCtx *s)
     if (s->len_prefix)
         len = get_bits(gb, s->log2_frame_size);
 
-    dprintf(s->avctx, "decoding frame with length %x\n", len);
+    ff_dprintf(s->avctx, "decoding frame with length %x\n", len);
 
     /** decode tile information */
     if (decode_tilehdr(s)) {
@@ -1303,7 +1303,7 @@ static int decode_frame(WMAProDecodeCtx *s)
     /** read drc info */
     if (s->dynamic_range_compression) {
         s->drc_gain = get_bits(gb, 8);
-        dprintf(s->avctx, "drc_gain %i\n", s->drc_gain);
+        ff_dprintf(s->avctx, "drc_gain %i\n", s->drc_gain);
     }
 
     /** no idea what these are for, might be the number of samples
@@ -1314,18 +1314,18 @@ static int decode_frame(WMAProDecodeCtx *s)
         /** usually true for the first frame */
         if (get_bits1(gb)) {
             skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            dprintf(s->avctx, "start skip: %i\n", skip);
+            ff_dprintf(s->avctx, "start skip: %i\n", skip);
         }
 
         /** sometimes true for the last frame */
         if (get_bits1(gb)) {
             skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            dprintf(s->avctx, "end skip: %i\n", skip);
+            ff_dprintf(s->avctx, "end skip: %i\n", skip);
         }
 
     }
 
-    dprintf(s->avctx, "BITSTREAM: frame header length was %i\n",
+    ff_dprintf(s->avctx, "BITSTREAM: frame header length was %i\n",
             get_bits_count(gb) - s->frame_offset);
 
     /** reset subframe states */
@@ -1488,7 +1488,7 @@ static int decode_packet(AVCodecContext *avctx,
 
         /** get number of bits that need to be added to the previous frame */
         num_bits_prev_frame = get_bits(gb, s->log2_frame_size);
-        dprintf(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
+        ff_dprintf(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
                 num_bits_prev_frame);
 
         /** check for packet loss */
@@ -1504,14 +1504,14 @@ static int decode_packet(AVCodecContext *avctx,
             /** append the previous frame data to the remaining data from the
                 previous packet to create a full frame */
             save_bits(s, gb, num_bits_prev_frame, 1);
-            dprintf(avctx, "accumulated %x bits of frame data\n",
+            ff_dprintf(avctx, "accumulated %x bits of frame data\n",
                     s->num_saved_bits - s->frame_offset);
 
             /** decode the cross packet frame if it is valid */
             if (!s->packet_loss)
                 decode_frame(s);
         } else if (s->num_saved_bits - s->frame_offset) {
-            dprintf(avctx, "ignoring %x previously saved bits\n",
+            ff_dprintf(avctx, "ignoring %x previously saved bits\n",
                     s->num_saved_bits - s->frame_offset);
         }
 
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index dc8f90d..babe14a 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -171,7 +171,7 @@ int avfilter_config_links(AVFilterContext *filter)
 
 void ff_dprintf_picref(void *ctx, AVFilterPicRef *picref, int end)
 {
-    dprintf(ctx,
+    ff_dprintf(ctx,
             "picref[%p data[%p, %p, %p, %p] linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64" a:%d/%d s:%dx%d]%s",
             picref,
             picref->data    [0], picref->data    [1], picref->data    [2], picref->data    [3],
@@ -183,7 +183,7 @@ void ff_dprintf_picref(void *ctx, AVFilterPicRef *picref, int end)
 
 void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
 {
-    dprintf(ctx,
+    ff_dprintf(ctx,
             "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
             link, link->w, link->h,
             av_pix_fmt_descriptors[link->format].name,
@@ -196,7 +196,7 @@ AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w,
 {
     AVFilterPicRef *ret = NULL;
 
-    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " perms:%d w:%d h:%d\n", perms, w, h);
+    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); ff_dprintf(NULL, " perms:%d w:%d h:%d\n", perms, w, h);
 
     if(link_dpad(link).get_video_buffer)
         ret = link_dpad(link).get_video_buffer(link, perms, w, h);
@@ -204,7 +204,7 @@ AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w,
     if(!ret)
         ret = avfilter_default_get_video_buffer(link, perms, w, h);
 
-    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); ff_dprintf_picref(NULL, ret, 1);
+    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); ff_dprintf(NULL, " returning "); ff_dprintf_picref(NULL, ret, 1);
 
     return ret;
 }
@@ -245,7 +245,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
     void (*start_frame)(AVFilterLink *, AVFilterPicRef *);
     AVFilterPad *dst = &link_dpad(link);
 
-    FF_DPRINTF_START(NULL, start_frame); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " "); ff_dprintf_picref(NULL, picref, 1);
+    FF_DPRINTF_START(NULL, start_frame); ff_dprintf_link(NULL, link, 0); ff_dprintf(NULL, " "); ff_dprintf_picref(NULL, picref, 1);
 
     if(!(start_frame = dst->start_frame))
         start_frame = avfilter_default_start_frame;
@@ -294,7 +294,7 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     int i, j, vsub;
     void (*draw_slice)(AVFilterLink *, int, int, int);
 
-    FF_DPRINTF_START(NULL, draw_slice); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
+    FF_DPRINTF_START(NULL, draw_slice); ff_dprintf_link(NULL, link, 0); ff_dprintf(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
 
     /* copy the slice if needed for permission reasons */
     if(link->srcpic) {
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 9ddde36..db203fc 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -30,6 +30,6 @@ void ff_dprintf_picref(void *ctx, AVFilterPicRef *picref, int end);
 
 void ff_dprintf_link(void *ctx, AVFilterLink *link, int end);
 
-#define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)
+#define FF_DPRINTF_START(ctx, func) ff_dprintf(NULL, "%-16s: ", #func)
 
 #endif  /* AVFILTER_INTERNAL_H */
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index f219390..70a3ff8 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -57,7 +57,7 @@ static int guidcmp(const void *g1, const void *g2)
 #ifdef DEBUG
 #define PRINT_IF_GUID(g,cmp) \
 if (!guidcmp(g, &cmp)) \
-    dprintf(NULL, "(GUID: %s) ", #cmp)
+    ff_dprintf(NULL, "(GUID: %s) ", #cmp)
 
 static void print_guid(const ff_asf_guid *g)
 {
@@ -87,10 +87,10 @@ static void print_guid(const ff_asf_guid *g)
     else PRINT_IF_GUID(g, stream_bitrate_guid);
     else PRINT_IF_GUID(g, ff_asf_language_guid);
     else
-        dprintf(NULL, "(GUID: unknown) ");
+        ff_dprintf(NULL, "(GUID: unknown) ");
     for(i=0;i<16;i++)
-        dprintf(NULL, " 0x%02x,", (*g)[i]);
-    dprintf(NULL, "}\n");
+        ff_dprintf(NULL, " 0x%02x,", (*g)[i]);
+    ff_dprintf(NULL, "}\n");
 }
 #undef PRINT_IF_GUID
 #else
@@ -208,9 +208,9 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
         uint64_t gpos= url_ftell(pb);
         get_guid(pb, &g);
         gsize = get_le64(pb);
-        dprintf(s, "%08"PRIx64": ", gpos);
+        ff_dprintf(s, "%08"PRIx64": ", gpos);
         print_guid(&g);
-        dprintf(s, "  size=0x%"PRIx64"\n", gsize);
+        ff_dprintf(s, "  size=0x%"PRIx64"\n", gsize);
         if (!guidcmp(&g, &ff_asf_data_header)) {
             asf->data_object_offset = url_ftell(pb);
             // if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
@@ -740,7 +740,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
     if (packet_length < asf->hdr.min_pktsize)
         padsize += asf->hdr.min_pktsize - packet_length;
     asf->packet_padsize = padsize;
-    dprintf(s, "packet: size=%d padsize=%d  left=%d\n", s->packet_size, asf->packet_padsize, asf->packet_size_left);
+    ff_dprintf(s, "packet: size=%d padsize=%d  left=%d\n", s->packet_size, asf->packet_padsize, asf->packet_size_left);
     return 0;
 }
 
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 05cfd98..a893d0d 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -81,7 +81,7 @@ static int guess_ni_flag(AVFormatContext *s);
 #ifdef DEBUG
 static void print_tag(const char *str, unsigned int tag, int size)
 {
-    dprintf(NULL, "%s: tag=%c%c%c%c size=0x%x\n",
+    ff_dprintf(NULL, "%s: tag=%c%c%c%c size=0x%x\n",
            str, tag & 0xff,
            (tag >> 8) & 0xff,
            (tag >> 16) & 0xff,
@@ -325,7 +325,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
                 avi->movi_list = url_ftell(pb) - 4;
                 if(size) avi->movi_end = avi->movi_list + size + (size & 1);
                 else     avi->movi_end = url_fsize(pb);
-                dprintf(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
+                ff_dprintf(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
                 goto end_of_header;
             }
             else if (tag1 == MKTAG('I', 'N', 'F', 'O'))
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index b2a4bc2..2f91ca6 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -402,7 +402,7 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
         if ((ret = ffm_is_avail_data(s, FRAME_HEADER_SIZE+4)) < 0)
             return ret;
 
-        dprintf(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
+        ff_dprintf(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
                url_ftell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
         if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
             FRAME_HEADER_SIZE)
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 063f906..6904854 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -418,7 +418,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
                     st->codec->sample_rate = cfg.ext_sample_rate;
                 else
                     st->codec->sample_rate = cfg.sample_rate;
-                dprintf(s, "mp4a config channels %d sample rate %d\n",
+                ff_dprintf(s, "mp4a config channels %d sample rate %d\n",
                         st->codec->channels, st->codec->sample_rate);
             }
 
diff --git a/libavformat/http.c b/libavformat/http.c
index eae780c..cecbaff 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -224,7 +224,7 @@ static int process_line(URLContext *h, char *line, int line_count,
             p++;
         s->http_code = strtol(p, &end, 10);
 
-        dprintf(NULL, "http_code=%d\n", s->http_code);
+        ff_dprintf(NULL, "http_code=%d\n", s->http_code);
 
         /* error codes are 4xx and 5xx, but regard 401 as a success, so we
          * don't abort until all headers have been parsed. */
@@ -351,7 +351,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
         if (http_get_line(s, line, sizeof(line)) < 0)
             return AVERROR(EIO);
 
-        dprintf(NULL, "header='%s'\n", line);
+        ff_dprintf(NULL, "header='%s'\n", line);
 
         err = process_line(h, line, s->line_count, new_location);
         if (err < 0)
@@ -382,7 +382,7 @@ static int http_read(URLContext *h, uint8_t *buf, int size)
 
                 s->chunksize = strtoll(line, NULL, 16);
 
-                dprintf(NULL, "Chunked encoding data size: %"PRId64"'\n", s->chunksize);
+                ff_dprintf(NULL, "Chunked encoding data size: %"PRId64"'\n", s->chunksize);
 
                 if (!s->chunksize)
                     return 0;
diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index f0f4217..40f7989 100644
--- a/libavformat/mmst.c
+++ b/libavformat/mmst.c
@@ -170,7 +170,7 @@ static int send_command_packet(MMSContext *mms)
     // write it out.
     write_result= url_write(mms->mms_hd, mms->out_buffer, exact_length);
     if(write_result != exact_length) {
-        dprintf(NULL, "url_write returned: %d != %d\n",
+        ff_dprintf(NULL, "url_write returned: %d != %d\n",
                 write_result, exact_length);
         return AVERROR_IO;
     }
@@ -231,11 +231,11 @@ static int send_media_file_request(MMSContext *mms)
 
 static void handle_packet_stream_changing_type(MMSContext *mms)
 {
-    dprintf(NULL, "Stream changing!\n");
+    ff_dprintf(NULL, "Stream changing!\n");
 
     // 40 is the packet header size, 7 is the prefix size.
     mms->header_packet_id= AV_RL32(mms->in_buffer + 40 + 7);
-    dprintf(NULL, "Changed header prefix to 0x%x", mms->header_packet_id);
+    ff_dprintf(NULL, "Changed header prefix to 0x%x", mms->header_packet_id);
 }
 
 static int send_keepalive_packet(MMSContext *mms)
@@ -273,11 +273,11 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
                     int length_remaining= AV_RL32(mms->in_buffer+8) + 4;
                     int hr;
 
-                    dprintf(NULL, "Length remaining is %d\n", length_remaining);
+                    ff_dprintf(NULL, "Length remaining is %d\n", length_remaining);
                     // read the rest of the packet.
                     if (length_remaining < 0
                         || length_remaining > sizeof(mms->in_buffer) - 12) {
-                        dprintf(NULL, "Incoming message len %d exceeds buffer len %d\n",
+                        ff_dprintf(NULL, "Incoming message len %d exceeds buffer len %d\n",
                             length_remaining, sizeof(mms->in_buffer) - 12);
                         return -1;
                     }
@@ -286,16 +286,16 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
                     if (read_result == length_remaining) {
                         packet_type= AV_RL16(mms->in_buffer+36);
                     } else {
-                        dprintf(NULL, "read for packet type failed%d!\n", read_result);
+                        ff_dprintf(NULL, "read for packet type failed%d!\n", read_result);
                         return -1;
                     }
                     hr = AV_RL32(mms->in_buffer + 40);
                     if (hr) {
-                        dprintf(NULL, "The server side send back error code:0x%x\n", hr);
+                        ff_dprintf(NULL, "The server side send back error code:0x%x\n", hr);
                         return -1;
                     }
                 } else {
-                    dprintf(NULL, "read for length remaining failed%d!\n", read_result);
+                    ff_dprintf(NULL, "read for length remaining failed%d!\n", read_result);
                     return -1;
                 }
             } else {
@@ -313,7 +313,7 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
 
                 if (length_remaining < 0
                         || length_remaining > sizeof(mms->in_buffer) - 8) {
-                    dprintf(NULL, "Incoming data len %d exceeds buffer len %d\n",
+                    ff_dprintf(NULL, "Incoming data len %d exceeds buffer len %d\n",
                             length_remaining, sizeof(mms->in_buffer));
                     return -1;
                 }
@@ -321,7 +321,7 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
                 mms->read_in_ptr         = mms->in_buffer;
                 read_result= url_read_complete(mms->mms_hd, mms->in_buffer, length_remaining);
                 if(read_result != length_remaining) {
-                    dprintf(NULL, "read_bytes result: %d asking for %d\n",
+                    ff_dprintf(NULL, "read_bytes result: %d asking for %d\n",
                             read_result, length_remaining);
                     return -1;
                 } else {
@@ -349,7 +349,7 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
                     } else if(packet_id_type == mms->packet_id) {
                         packet_type = SC_PKT_ASF_MEDIA;
                     } else {
-                        dprintf(NULL, "packet id type %d is old.", packet_id_type);
+                        ff_dprintf(NULL, "packet id type %d is old.", packet_id_type);
                         continue;
                     }
                 }
@@ -367,10 +367,10 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
             return packet_type;
         } else {
             if(read_result<0) {
-                dprintf(NULL, "Read error (or cancelled) returned %d!\n", read_result);
+                ff_dprintf(NULL, "Read error (or cancelled) returned %d!\n", read_result);
                 packet_type = SC_PKT_CANCEL;
             } else {
-                dprintf(NULL, "Read result of zero?!\n");
+                ff_dprintf(NULL, "Read result of zero?!\n");
                 packet_type = SC_PKT_NO_DATA;
             }
             return packet_type;
@@ -386,13 +386,13 @@ static int mms_safe_send_recv(MMSContext *mms,
     if(send_fun) {
         int ret = send_fun(mms);
         if (ret < 0) {
-            dprintf(NULL, "Send Packet error before expecting recv packet %d\n", expect_type);
+            ff_dprintf(NULL, "Send Packet error before expecting recv packet %d\n", expect_type);
             return ret;
         }
     }
 
     if ((type = get_tcp_server_response(mms)) != expect_type) {
-        dprintf(NULL,"Unexpected packet type %d with type %d\n", type, expect_type);
+        ff_dprintf(NULL,"Unexpected packet type %d with type %d\n", type, expect_type);
         return -1;
     } else {
         return 0;
@@ -455,7 +455,7 @@ static int asf_header_parser(MMSContext *mms)
     while(end - p >= sizeof(ff_asf_guid) + 8) {
         uint64_t chunksize = AV_RL64(p + sizeof(ff_asf_guid));
         if (!chunksize || chunksize > end - p) {
-            dprintf(NULL, "chunksize is exceptional value:%"PRId64"!\n", chunksize);
+            ff_dprintf(NULL, "chunksize is exceptional value:%"PRId64"!\n", chunksize);
             return -1;
         }
         if (!memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) {
@@ -463,7 +463,7 @@ static int asf_header_parser(MMSContext *mms)
             if (end - p > sizeof(ff_asf_guid) * 2 + 68) {
                 mms->asf_packet_len = AV_RL32(p + sizeof(ff_asf_guid) * 2 + 64);
                 if (mms->asf_packet_len <= 0 || mms->asf_packet_len > sizeof(mms->in_buffer)) {
-                    dprintf(NULL,"Too large packet len:%d"
+                    ff_dprintf(NULL,"Too large packet len:%d"
                         " may overwrite in_buffer when padding", mms->asf_packet_len);
                     return -1;
                 }
@@ -479,7 +479,7 @@ static int asf_header_parser(MMSContext *mms)
                 mms->streams[mms->stream_num].id = stream_id;
                 mms->stream_num++;
             } else {
-                dprintf(NULL, "Too many streams.\n");
+                ff_dprintf(NULL, "Too many streams.\n");
                 return -1;
             }
         } else if (!memcmp(p, ff_asf_head1_guid, sizeof(ff_asf_guid))) {
@@ -531,7 +531,7 @@ static int read_mms_packet(MMSContext *mms, uint8_t *buf, int buf_size)
             memcpy(buf, mms->asf_header + mms->asf_header_read_size, size_to_copy);
             mms->asf_header_read_size += size_to_copy;
             result += size_to_copy;
-            dprintf(NULL, "Copied %d bytes from stored header. left: %d\n",
+            ff_dprintf(NULL, "Copied %d bytes from stored header. left: %d\n",
                    size_to_copy, mms->asf_header_size - mms->asf_header_read_size);
             if (mms->asf_header_size == mms->asf_header_read_size) {
                 av_freep(&mms->asf_header);
@@ -546,7 +546,7 @@ static int read_mms_packet(MMSContext *mms, uint8_t *buf, int buf_size)
             int err = mms_safe_send_recv(mms, NULL, SC_PKT_ASF_MEDIA);
             if (err == 0) {
                 if(mms->remaining_in_len>mms->asf_packet_len) {
-                    dprintf(NULL, "Incoming packet"
+                    ff_dprintf(NULL, "Incoming packet"
                             "larger than the asf packet size stated (%d>%d)\n",
                             mms->remaining_in_len, mms->asf_packet_len);
                     result= AVERROR_IO;
@@ -554,12 +554,12 @@ static int read_mms_packet(MMSContext *mms, uint8_t *buf, int buf_size)
                     // copy the data to the packet buffer.
                     result = read_data(mms, buf, buf_size);
                     if (result == 0) {
-                        dprintf(NULL, "read asf media paket size is zero!\n");
+                        ff_dprintf(NULL, "read asf media paket size is zero!\n");
                         break;
                     }
                 }
             } else {
-                dprintf(NULL, "read packet error!\n");
+                ff_dprintf(NULL, "read packet error!\n");
                 break;
             }
         }
@@ -641,7 +641,7 @@ static int mms_open(URLContext *h, const char *uri, int flags)
         goto fail;
     err = asf_header_parser(mms);
     if (err) {
-        dprintf(NULL, "asf header parsed failed!\n");
+        ff_dprintf(NULL, "asf header parsed failed!\n");
         goto fail;
     }
     mms->header_parsed = 1;
@@ -649,11 +649,11 @@ static int mms_open(URLContext *h, const char *uri, int flags)
     if (!mms->asf_packet_len || !mms->stream_num)
         goto fail;
 
-    dprintf(NULL, "Leaving open (success)\n");
+    ff_dprintf(NULL, "Leaving open (success)\n");
     return 0;
 fail:
     mms_close(h);
-    dprintf(NULL, "Leaving open (failure: %d)\n", err);
+    ff_dprintf(NULL, "Leaving open (failure: %d)\n", err);
     return err;
 }
 
@@ -692,7 +692,7 @@ static int mms_read(URLContext *h, uint8_t *buf, int size)
     assert(mms->header_parsed);
 
     if (!mms->is_playing) {
-        dprintf(NULL, "mms_read() before play().\n");
+        ff_dprintf(NULL, "mms_read() before play().\n");
         clear_stream_buffers(mms);
         result = mms_safe_send_recv(mms, send_stream_selection_request, SC_PKT_STREAM_ID_ACCEPTED);
         if (result)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index bf986b3..5fd42bd 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -267,7 +267,7 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
             a.size = get_be32(pb);
             a.type = get_le32(pb);
         }
-        dprintf(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
+        ff_dprintf(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
                 a.type, (char*)&a.type, (char*)&atom.type, a.size, total_size, atom.size);
         total_size += 8;
         if (a.size == 1) { /* 64 bit extended size */
@@ -347,7 +347,7 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 
         dref->type = get_le32(pb);
         get_be32(pb); // version + flags
-        dprintf(c->fc, "type %.4s size %d\n", (char*)&dref->type, size);
+        ff_dprintf(c->fc, "type %.4s size %d\n", (char*)&dref->type, size);
 
         if (dref->type == MKTAG('a','l','i','s') && size > 150) {
             /* macintosh alias record */
@@ -439,8 +439,8 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     ctype = get_le32(pb);
     type = get_le32(pb); /* component subtype */
 
-    dprintf(c->fc, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
-    dprintf(c->fc, "stype= %.4s\n", (char*)&type);
+    ff_dprintf(c->fc, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
+    ff_dprintf(c->fc, "stype= %.4s\n", (char*)&type);
 
     if     (type == MKTAG('v','i','d','e'))
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@@ -476,7 +476,7 @@ static int mp4_read_descr(AVFormatContext *fc, ByteIOContext *pb, int *tag)
     int len;
     *tag = get_byte(pb);
     len = ff_mp4_read_descr_len(pb);
-    dprintf(fc, "MPEG4 description: tag=0x%02x len=%d\n", *tag, len);
+    ff_dprintf(fc, "MPEG4 description: tag=0x%02x len=%d\n", *tag, len);
     return len;
 }
 
@@ -519,10 +519,10 @@ int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
         get_be32(pb); /* avg bitrate */
 
         st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
-        dprintf(fc, "esds object type id 0x%02x\n", object_type_id);
+        ff_dprintf(fc, "esds object type id 0x%02x\n", object_type_id);
         len = mp4_read_descr(fc, pb, &tag);
         if (tag == MP4DecSpecificDescrTag) {
-            dprintf(fc, "Specific MPEG4 header len=%d\n", len);
+            ff_dprintf(fc, "Specific MPEG4 header len=%d\n", len);
             if((uint64_t)len > (1<<30))
                 return -1;
             st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
@@ -541,7 +541,7 @@ int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
                     st->codec->sample_rate = cfg.ext_sample_rate;
                 else
                     st->codec->sample_rate = cfg.sample_rate;
-                dprintf(fc, "mp4a config channels %d obj %d ext obj %d "
+                ff_dprintf(fc, "mp4a config channels %d obj %d ext obj %d "
                         "sample rate %d ext sample rate %d\n", st->codec->channels,
                         cfg.object_type, cfg.ext_object_type,
                         cfg.sample_rate, cfg.ext_sample_rate);
@@ -636,7 +636,7 @@ static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 static int mov_read_moof(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 {
     c->fragment.moof_offset = url_ftell(pb) - 8;
-    dprintf(c->fc, "moof offset %llx\n", c->fragment.moof_offset);
+    ff_dprintf(c->fc, "moof offset %llx\n", c->fragment.moof_offset);
     return mov_read_default(c, pb, atom);
 }
 
@@ -691,7 +691,7 @@ static int mov_read_mvhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     }
     c->time_scale = get_be32(pb); /* time scale */
 
-    dprintf(c->fc, "time scale = %i\n", c->time_scale);
+    ff_dprintf(c->fc, "time scale = %i\n", c->time_scale);
 
     c->duration = (version == 1) ? get_be64(pb) : get_be32(pb); /* duration */
     get_be32(pb); /* preferred scale */
@@ -733,7 +733,7 @@ static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     st->codec->extradata_size = 0x5a + atom.size;
     memcpy(st->codec->extradata, "SVQ3", 4); // fake
     get_buffer(pb, st->codec->extradata + 0x5a, atom.size);
-    dprintf(c->fc, "Reading SMI %"PRId64"  %s\n", atom.size, st->codec->extradata + 0x5a);
+    ff_dprintf(c->fc, "Reading SMI %"PRId64"  %s\n", atom.size, st->codec->extradata + 0x5a);
     return 0;
 }
 
@@ -747,7 +747,7 @@ static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     st = c->fc->streams[c->fc->nb_streams-1];
 
     little_endian = get_be16(pb);
-    dprintf(c->fc, "enda %d\n", little_endian);
+    ff_dprintf(c->fc, "enda %d\n", little_endian);
     if (little_endian == 1) {
         switch (st->codec->codec_id) {
         case CODEC_ID_PCM_S24BE:
@@ -1011,7 +1011,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
             }
         }
 
-        dprintf(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,
+        ff_dprintf(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,
                 (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
                 (format >> 24) & 0xff, st->codec->codec_type);
 
@@ -1046,7 +1046,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 
             st->codec->bits_per_coded_sample = get_be16(pb); /* depth */
             st->codec->color_table_id = get_be16(pb); /* colortable id */
-            dprintf(c->fc, "depth %d, ctab id %d\n",
+            ff_dprintf(c->fc, "depth %d, ctab id %d\n",
                    st->codec->bits_per_coded_sample, st->codec->color_table_id);
             /* figure out the palette situation */
             color_depth = st->codec->bits_per_coded_sample & 0x1F;
@@ -1128,7 +1128,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
             get_be32(pb); /* vendor */
 
             st->codec->channels = get_be16(pb);             /* channel count */
-            dprintf(c->fc, "audio channels %d\n", st->codec->channels);
+            ff_dprintf(c->fc, "audio channels %d\n", st->codec->channels);
             st->codec->bits_per_coded_sample = get_be16(pb);      /* sample size */
 
             sc->audio_cid = get_be16(pb);
@@ -1137,7 +1137,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
             st->codec->sample_rate = ((get_be32(pb) >> 16));
 
             //Read QT version 1 fields. In version 0 these do not exist.
-            dprintf(c->fc, "version =%d, isom =%d\n",version,c->isom);
+            ff_dprintf(c->fc, "version =%d, isom =%d\n",version,c->isom);
             if(!c->isom) {
                 if(version==1) {
                     sc->samples_per_frame = get_be32(pb);
@@ -1295,7 +1295,7 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 
     entries = get_be32(pb);
 
-    dprintf(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
+    ff_dprintf(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
 
     if(entries >= UINT_MAX / sizeof(*sc->stsc_data))
         return -1;
@@ -1335,7 +1335,7 @@ static int mov_read_stps(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 
     for (i = 0; i < entries; i++) {
         sc->stps_data[i] = get_be32(pb);
-        //dprintf(c->fc, "stps %d\n", sc->stps_data[i]);
+        //ff_dprintf(c->fc, "stps %d\n", sc->stps_data[i]);
     }
 
     return 0;
@@ -1357,7 +1357,7 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 
     entries = get_be32(pb);
 
-    dprintf(c->fc, "keyframe_count = %d\n", entries);
+    ff_dprintf(c->fc, "keyframe_count = %d\n", entries);
 
     if(entries >= UINT_MAX / sizeof(int))
         return -1;
@@ -1368,7 +1368,7 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 
     for(i=0; i<entries; i++) {
         sc->keyframes[i] = get_be32(pb);
-        //dprintf(c->fc, "keyframes[]=%d\n", sc->keyframes[i]);
+        //ff_dprintf(c->fc, "keyframes[]=%d\n", sc->keyframes[i]);
     }
     return 0;
 }
@@ -1401,7 +1401,7 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     }
     entries = get_be32(pb);
 
-    dprintf(c->fc, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
+    ff_dprintf(c->fc, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
 
     sc->sample_count = entries;
     if (sample_size)
@@ -1458,7 +1458,7 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     get_be24(pb); /* flags */
     entries = get_be32(pb);
 
-    dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
+    ff_dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
 
     if(entries >= UINT_MAX / sizeof(*sc->stts_data))
         return -1;
@@ -1476,7 +1476,7 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
         sc->stts_data[i].count= sample_count;
         sc->stts_data[i].duration= sample_duration;
 
-        dprintf(c->fc, "sample_count=%d, sample_duration=%d\n",sample_count,sample_duration);
+        ff_dprintf(c->fc, "sample_count=%d, sample_duration=%d\n",sample_count,sample_duration);
 
         duration+=(int64_t)sample_duration*sample_count;
         total_sample_count+=sample_count;
@@ -1503,7 +1503,7 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     get_be24(pb); /* flags */
     entries = get_be32(pb);
 
-    dprintf(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
+    ff_dprintf(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
 
     if(entries >= UINT_MAX / sizeof(*sc->ctts_data))
         return -1;
@@ -1522,7 +1522,7 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
             sc->dts_shift = FFMAX(sc->dts_shift, -duration);
     }
 
-    dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
+    ff_dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
 
     return 0;
 }
@@ -1601,7 +1601,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                     e->size = sample_size;
                     e->min_distance = distance;
                     e->flags = keyframe ? AVINDEX_KEYFRAME : 0;
-                    dprintf(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
+                    ff_dprintf(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
                             "size %d, distance %d, keyframe %d\n", st->index, current_sample,
                             current_offset, current_dts, sample_size, distance, keyframe);
                 }
@@ -1649,7 +1649,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
             total += chunk_count * count;
         }
 
-        dprintf(mov->fc, "chunk count %d\n", total);
+        ff_dprintf(mov->fc, "chunk count %d\n", total);
         if (total >= UINT_MAX / sizeof(*st->index_entries))
             return;
         st->index_entries = av_malloc(total*sizeof(*st->index_entries));
@@ -1693,7 +1693,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                 e->size = size;
                 e->min_distance = 0;
                 e->flags = AVINDEX_KEYFRAME;
-                dprintf(mov->fc, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
+                ff_dprintf(mov->fc, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
                         "size %d, duration %d\n", st->index, i, current_offset, current_dts,
                         size, samples);
 
@@ -1787,7 +1787,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
         !st->codec->frame_size && sc->stts_count == 1) {
         st->codec->frame_size = av_rescale(sc->stts_data[0].duration,
                                            st->codec->sample_rate, sc->time_scale);
-        dprintf(c->fc, "frame size %d\n", st->codec->frame_size);
+        ff_dprintf(c->fc, "frame size %d\n", st->codec->frame_size);
     }
 
     mov_build_index(c, st);
@@ -1980,7 +1980,7 @@ static int mov_read_tfhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     frag->duration = flags & 0x08 ? get_be32(pb) : trex->duration;
     frag->size     = flags & 0x10 ? get_be32(pb) : trex->size;
     frag->flags    = flags & 0x20 ? get_be32(pb) : trex->flags;
-    dprintf(c->fc, "frag flags 0x%x\n", frag->flags);
+    ff_dprintf(c->fc, "frag flags 0x%x\n", frag->flags);
     return 0;
 }
 
@@ -2038,7 +2038,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     get_byte(pb); /* version */
     flags = get_be24(pb);
     entries = get_be32(pb);
-    dprintf(c->fc, "flags 0x%x entries %d\n", flags, entries);
+    ff_dprintf(c->fc, "flags 0x%x entries %d\n", flags, entries);
     if (flags & 0x001) data_offset        = get_be32(pb);
     if (flags & 0x004) first_sample_flags = get_be32(pb);
     if (flags & 0x800) {
@@ -2054,7 +2054,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     dts = st->duration;
     offset = frag->base_data_offset + data_offset;
     distance = 0;
-    dprintf(c->fc, "first sample flags 0x%x\n", first_sample_flags);
+    ff_dprintf(c->fc, "first sample flags 0x%x\n", first_sample_flags);
     for (i = 0; i < entries; i++) {
         unsigned sample_size = frag->size;
         int sample_flags = i ? frag->flags : first_sample_flags;
@@ -2074,7 +2074,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
             distance = 0;
         av_add_index_entry(st, offset, dts, sample_size, distance,
                            keyframe ? AVINDEX_KEYFRAME : 0);
-        dprintf(c->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
+        ff_dprintf(c->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
                 "size %d, distance %d, keyframe %d\n", st->index, sc->sample_count+i,
                 offset, dts, sample_size, distance, keyframe);
         distance++;
@@ -2191,7 +2191,7 @@ static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
         av_log(c->fc, AV_LOG_WARNING, "multiple edit list entries, "
                "a/v desync might occur, patch welcome\n");
 
-    dprintf(c->fc, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
+    ff_dprintf(c->fc, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
     return 0;
 }
 
@@ -2385,7 +2385,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
         av_log(s, AV_LOG_ERROR, "moov atom not found\n");
         return -1;
     }
-    dprintf(mov->fc, "on_parse_exit_offset=%lld\n", url_ftell(pb));
+    ff_dprintf(mov->fc, "on_parse_exit_offset=%lld\n", url_ftell(pb));
 
     if (!url_is_streamed(pb) && mov->chapter_track > 0)
         mov_read_chapters(s);
@@ -2404,7 +2404,7 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
         if (msc->pb && msc->current_sample < avst->nb_index_entries) {
             AVIndexEntry *current_sample = &avst->index_entries[msc->current_sample];
             int64_t dts = av_rescale(current_sample->timestamp, AV_TIME_BASE, msc->time_scale);
-            dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
+            ff_dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
             if (!sample || (url_is_streamed(s->pb) && current_sample->pos < sample->pos) ||
                 (!url_is_streamed(s->pb) &&
                  ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
@@ -2434,7 +2434,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
             mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
             url_feof(s->pb))
             return AVERROR_EOF;
-        dprintf(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb));
+        ff_dprintf(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb));
         goto retry;
     }
     sc = st->priv_data;
@@ -2485,7 +2485,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
         goto retry;
     pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? AV_PKT_FLAG_KEY : 0;
     pkt->pos = sample->pos;
-    dprintf(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n",
+    ff_dprintf(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n",
             pkt->stream_index, pkt->pts, pkt->dts, pkt->pos, pkt->duration);
     return 0;
 }
@@ -2497,13 +2497,13 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
     int i;
 
     sample = av_index_search_timestamp(st, timestamp, flags);
-    dprintf(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
+    ff_dprintf(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
     if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
         sample = 0;
     if (sample < 0) /* not sure what to do */
         return -1;
     sc->current_sample = sample;
-    dprintf(s, "stream %d, found sample %d\n", st->index, sc->current_sample);
+    ff_dprintf(s, "stream %d, found sample %d\n", st->index, sc->current_sample);
     /* adjust ctts index */
     if (sc->ctts_data) {
         time_sample = 0;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b160090..94e3905 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -288,7 +288,7 @@ static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int
     MpegTSFilter *filter;
     MpegTSSectionFilter *sec;
 
-    dprintf(ts->stream, "Filter: pid=0x%x\n", pid);
+    ff_dprintf(ts->stream, "Filter: pid=0x%x\n", pid);
 
     if (pid >= NB_PID_MAX || ts->pids[pid])
         return NULL;
@@ -680,7 +680,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
                     pes->header[2] == 0x01) {
                     /* it must be an mpeg2 PES stream */
                     code = pes->header[3] | 0x100;
-                    dprintf(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
+                    ff_dprintf(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
 
                     if ((!pes->st && pes->stream->nb_streams == MAX_STREAMS) ||
                         (pes->st && pes->st->discard == AVDISCARD_ALL) ||
@@ -712,7 +712,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
                         code != 0x1f8) {                  /* ITU-T Rec. H.222.1 type E stream */
                         pes->state = MPEGTS_PESHEADER;
                         if (pes->st->codec->codec_id == CODEC_ID_NONE) {
-                            dprintf(pes->stream, "pid=%x stream_type=%x probing\n",
+                            ff_dprintf(pes->stream, "pid=%x stream_type=%x probing\n",
                                     pes->pid, pes->stream_type);
                             pes->st->codec->codec_id = CODEC_ID_PROBE;
                         }
@@ -864,7 +864,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     uint32_t prog_reg_desc = 0; /* registration descriptor */
 
 #ifdef DEBUG
-    dprintf(ts->stream, "PMT: len %i\n", section_len);
+    ff_dprintf(ts->stream, "PMT: len %i\n", section_len);
     av_hex_dump_log(ts->stream, AV_LOG_DEBUG, (uint8_t *)section, section_len);
 #endif
 
@@ -873,7 +873,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     if (parse_section_header(h, &p, p_end) < 0)
         return;
 
-    dprintf(ts->stream, "sid=0x%x sec_num=%d/%d\n",
+    ff_dprintf(ts->stream, "sid=0x%x sec_num=%d/%d\n",
            h->id, h->sec_num, h->last_sec_num);
 
     if (h->tid != PMT_TID)
@@ -885,7 +885,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
         return;
     add_pid_to_pmt(ts, h->id, pcr_pid);
 
-    dprintf(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
+    ff_dprintf(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
 
     program_info_length = get16(&p, p_end) & 0xfff;
     if (program_info_length < 0)
@@ -959,7 +959,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
             if (desc_end > desc_list_end)
                 break;
 
-            dprintf(ts->stream, "tag: 0x%02x len=%d\n",
+            ff_dprintf(ts->stream, "tag: 0x%02x len=%d\n",
                    desc_tag, desc_len);
 
             if (st->codec->codec_id == CODEC_ID_NONE &&
@@ -1002,7 +1002,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
                 break;
             case 0x05: /* registration descriptor */
                 st->codec->codec_tag = bytestream_get_le32(&p);
-                dprintf(ts->stream, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag);
+                ff_dprintf(ts->stream, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag);
                 if (st->codec->codec_id == CODEC_ID_NONE &&
                     stream_type == STREAM_TYPE_PRIVATE_DATA)
                     mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types);
@@ -1031,7 +1031,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     int sid, pmt_pid;
 
 #ifdef DEBUG
-    dprintf(ts->stream, "PAT:\n");
+    ff_dprintf(ts->stream, "PAT:\n");
     av_hex_dump_log(ts->stream, AV_LOG_DEBUG, (uint8_t *)section, section_len);
 #endif
     p_end = section + section_len - 4;
@@ -1050,7 +1050,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
         if (pmt_pid < 0)
             break;
 
-        dprintf(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
+        ff_dprintf(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
 
         if (sid == 0x0000) {
             /* NIT info */
@@ -1073,7 +1073,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     char *name, *provider_name;
 
 #ifdef DEBUG
-    dprintf(ts->stream, "SDT:\n");
+    ff_dprintf(ts->stream, "SDT:\n");
     av_hex_dump_log(ts->stream, AV_LOG_DEBUG, (uint8_t *)section, section_len);
 #endif
 
@@ -1111,7 +1111,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
             if (desc_end > desc_list_end)
                 break;
 
-            dprintf(ts->stream, "tag: 0x%02x len=%d\n",
+            ff_dprintf(ts->stream, "tag: 0x%02x len=%d\n",
                    desc_tag, desc_len);
 
             switch(desc_tag) {
@@ -1398,7 +1398,7 @@ static int mpegts_read_header(AVFormatContext *s,
 
         ts->auto_guess = 1;
 
-        dprintf(ts->stream, "tuning done\n");
+        ff_dprintf(ts->stream, "tuning done\n");
 
         s->ctx_flags |= AVFMTCTX_NOHEADER;
     } else {
diff --git a/libavformat/mxf.h b/libavformat/mxf.h
index 26832c2..d67e827 100644
--- a/libavformat/mxf.h
+++ b/libavformat/mxf.h
@@ -71,7 +71,7 @@ extern const MXFPixelLayout ff_mxf_pixel_layouts[];
 int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt);
 
 #ifdef DEBUG
-#define PRINT_KEY(pc, s, x) dprintf(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
+#define PRINT_KEY(pc, s, x) ff_dprintf(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
                              (x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
 #else
 #define PRINT_KEY(pc, s, x)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 7bca687..af5f2e4 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -309,7 +309,7 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
         if (klv_read_packet(&klv, s->pb) < 0)
             return -1;
         PRINT_KEY(s, "read packet", klv.key);
-        dprintf(s, "size %lld offset %#llx\n", klv.length, klv.offset);
+        ff_dprintf(s, "size %lld offset %#llx\n", klv.length, klv.offset);
         if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) {
             int res = mxf_decrypt_triplet(s, pkt, &klv);
             if (res < 0) {
@@ -518,12 +518,12 @@ static int mxf_read_source_package(void *arg, ByteIOContext *pb, int tag, int si
 static int mxf_read_index_table_segment(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
 {
     switch(tag) {
-    case 0x3F05: dprintf(NULL, "EditUnitByteCount %d\n", get_be32(pb)); break;
-    case 0x3F06: dprintf(NULL, "IndexSID %d\n", get_be32(pb)); break;
-    case 0x3F07: dprintf(NULL, "BodySID %d\n", get_be32(pb)); break;
-    case 0x3F0B: dprintf(NULL, "IndexEditRate %d/%d\n", get_be32(pb), get_be32(pb)); break;
-    case 0x3F0C: dprintf(NULL, "IndexStartPosition %lld\n", get_be64(pb)); break;
-    case 0x3F0D: dprintf(NULL, "IndexDuration %lld\n", get_be64(pb)); break;
+    case 0x3F05: ff_dprintf(NULL, "EditUnitByteCount %d\n", get_be32(pb)); break;
+    case 0x3F06: ff_dprintf(NULL, "IndexSID %d\n", get_be32(pb)); break;
+    case 0x3F07: ff_dprintf(NULL, "BodySID %d\n", get_be32(pb)); break;
+    case 0x3F0B: ff_dprintf(NULL, "IndexEditRate %d/%d\n", get_be32(pb), get_be32(pb)); break;
+    case 0x3F0C: ff_dprintf(NULL, "IndexStartPosition %lld\n", get_be64(pb)); break;
+    case 0x3F0D: ff_dprintf(NULL, "IndexDuration %lld\n", get_be64(pb)); break;
     }
     return 0;
 }
@@ -536,7 +536,7 @@ static void mxf_read_pixel_layout(ByteIOContext *pb, MXFDescriptor *descriptor)
     do {
         code = get_byte(pb);
         value = get_byte(pb);
-        dprintf(NULL, "pixel layout: code %#x\n", code);
+        ff_dprintf(NULL, "pixel layout: code %#x\n", code);
 
         if (ofs < 16) {
             layout[ofs++] = code;
@@ -666,7 +666,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
     MXFPackage *temp_package = NULL;
     int i, j, k;
 
-    dprintf(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count);
+    ff_dprintf(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count);
     /* TODO: handle multiple material packages (OP3x) */
     for (i = 0; i < mxf->packages_count; i++) {
         material_package = mxf_resolve_strong_ref(mxf, &mxf->packages_refs[i], MaterialPackage);
@@ -876,7 +876,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
         uint64_t next = url_ftell(pb) + size;
         UID uid = {0};
 
-        dprintf(mxf->fc, "local tag %#04x size %d\n", tag, size);
+        ff_dprintf(mxf->fc, "local tag %#04x size %d\n", tag, size);
         if (!size) { /* ignore empty tag, needed for some files with empty UMID tag */
             av_log(mxf->fc, AV_LOG_ERROR, "local tag %#04x with 0 size\n", tag);
             continue;
@@ -887,7 +887,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
                 int local_tag = AV_RB16(mxf->local_tags+i*18);
                 if (local_tag == tag) {
                     memcpy(uid, mxf->local_tags+i*18+2, 16);
-                    dprintf(mxf->fc, "local tag %#04x\n", local_tag);
+                    ff_dprintf(mxf->fc, "local tag %#04x\n", local_tag);
                     PRINT_KEY(mxf->fc, "uid", uid);
                 }
             }
@@ -920,7 +920,7 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
         if (klv_read_packet(&klv, s->pb) < 0)
             return -1;
         PRINT_KEY(s, "read header", klv.key);
-        dprintf(s, "size %lld offset %#llx\n", klv.length, klv.offset);
+        ff_dprintf(s, "size %lld offset %#llx\n", klv.length, klv.offset);
         if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
             IS_KLV_KEY(klv.key, mxf_essence_element_key)) {
             /* FIXME avoid seek */
diff --git a/libavformat/r3d.c b/libavformat/r3d.c
index 556a32b..5319687 100644
--- a/libavformat/r3d.c
+++ b/libavformat/r3d.c
@@ -43,7 +43,7 @@ static int read_atom(AVFormatContext *s, Atom *atom)
     if (atom->size < 8)
         return -1;
     atom->tag = get_le32(s->pb);
-    dprintf(s, "atom %d %.4s offset %#llx\n",
+    ff_dprintf(s, "atom %d %.4s offset %#llx\n",
             atom->size, (char*)&atom->tag, atom->offset);
     return atom->size;
 }
@@ -61,16 +61,16 @@ static int r3d_read_red1(AVFormatContext *s)
 
     tmp  = get_byte(s->pb); // major version
     tmp2 = get_byte(s->pb); // minor version
-    dprintf(s, "version %d.%d\n", tmp, tmp2);
+    ff_dprintf(s, "version %d.%d\n", tmp, tmp2);
 
     tmp = get_be16(s->pb); // unknown
-    dprintf(s, "unknown1 %d\n", tmp);
+    ff_dprintf(s, "unknown1 %d\n", tmp);
 
     tmp = get_be32(s->pb);
     av_set_pts_info(st, 32, 1, tmp);
 
     tmp = get_be32(s->pb); // filenum
-    dprintf(s, "filenum %d\n", tmp);
+    ff_dprintf(s, "filenum %d\n", tmp);
 
     url_fskip(s->pb, 32); // unknown
 
@@ -78,13 +78,13 @@ static int r3d_read_red1(AVFormatContext *s)
     st->codec->height = get_be32(s->pb);
 
     tmp = get_be16(s->pb); // unknown
-    dprintf(s, "unknown2 %d\n", tmp);
+    ff_dprintf(s, "unknown2 %d\n", tmp);
 
     st->codec->time_base.den = get_be16(s->pb);
     st->codec->time_base.num = get_be16(s->pb);
 
     tmp = get_byte(s->pb); // audio channels
-    dprintf(s, "audio channels %d\n", tmp);
+    ff_dprintf(s, "audio channels %d\n", tmp);
     if (tmp > 0) {
         AVStream *ast = av_new_stream(s, 1);
         if (!ast)
@@ -99,10 +99,10 @@ static int r3d_read_red1(AVFormatContext *s)
     filename[sizeof(filename)-1] = 0;
     av_metadata_set2(&st->metadata, "filename", filename, 0);
 
-    dprintf(s, "filename %s\n", filename);
-    dprintf(s, "resolution %dx%d\n", st->codec->width, st->codec->height);
-    dprintf(s, "timescale %d\n", st->time_base.den);
-    dprintf(s, "frame rate %d/%d\n",
+    ff_dprintf(s, "filename %s\n", filename);
+    ff_dprintf(s, "resolution %dx%d\n", st->codec->width, st->codec->height);
+    ff_dprintf(s, "timescale %d\n", st->time_base.den);
+    ff_dprintf(s, "frame rate %d/%d\n",
             st->codec->time_base.num, st->codec->time_base.den);
 
     return 0;
@@ -125,13 +125,13 @@ static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)
             r3d->video_offsets_count = i;
             break;
         }
-        dprintf(s, "video offset %d: %#x\n", i, r3d->video_offsets[i]);
+        ff_dprintf(s, "video offset %d: %#x\n", i, r3d->video_offsets[i]);
     }
 
     if (st->codec->time_base.den)
         st->duration = (uint64_t)r3d->video_offsets_count*
             st->time_base.den*st->codec->time_base.num/st->codec->time_base.den;
-    dprintf(s, "duration %lld\n", st->duration);
+    ff_dprintf(s, "duration %lld\n", st->duration);
 
     return 0;
 }
@@ -147,10 +147,10 @@ static void r3d_read_reos(AVFormatContext *s)
     get_be32(s->pb); // rdas offset
 
     tmp = get_be32(s->pb);
-    dprintf(s, "num video chunks %d\n", tmp);
+    ff_dprintf(s, "num video chunks %d\n", tmp);
 
     tmp = get_be32(s->pb);
-    dprintf(s, "num audio chunks %d\n", tmp);
+    ff_dprintf(s, "num audio chunks %d\n", tmp);
 
     url_fskip(s->pb, 6*4);
 }
@@ -176,7 +176,7 @@ static int r3d_read_header(AVFormatContext *s, AVFormatParameters *ap)
     }
 
     s->data_offset = url_ftell(s->pb);
-    dprintf(s, "data offset %#llx\n", s->data_offset);
+    ff_dprintf(s, "data offset %#llx\n", s->data_offset);
     if (url_is_streamed(s->pb))
         return 0;
     // find REOB/REOF/REOS to load index
@@ -217,29 +217,29 @@ static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
     dts = get_be32(s->pb);
 
     tmp = get_be32(s->pb);
-    dprintf(s, "frame num %d\n", tmp);
+    ff_dprintf(s, "frame num %d\n", tmp);
 
     tmp  = get_byte(s->pb); // major version
     tmp2 = get_byte(s->pb); // minor version
-    dprintf(s, "version %d.%d\n", tmp, tmp2);
+    ff_dprintf(s, "version %d.%d\n", tmp, tmp2);
 
     tmp = get_be16(s->pb); // unknown
-    dprintf(s, "unknown %d\n", tmp);
+    ff_dprintf(s, "unknown %d\n", tmp);
 
     if (tmp > 4) {
         tmp = get_be16(s->pb); // unknown
-        dprintf(s, "unknown %d\n", tmp);
+        ff_dprintf(s, "unknown %d\n", tmp);
 
         tmp = get_be16(s->pb); // unknown
-        dprintf(s, "unknown %d\n", tmp);
+        ff_dprintf(s, "unknown %d\n", tmp);
 
         tmp = get_be32(s->pb);
-        dprintf(s, "width %d\n", tmp);
+        ff_dprintf(s, "width %d\n", tmp);
         tmp = get_be32(s->pb);
-        dprintf(s, "height %d\n", tmp);
+        ff_dprintf(s, "height %d\n", tmp);
 
         tmp = get_be32(s->pb);
-        dprintf(s, "metadata len %d\n", tmp);
+        ff_dprintf(s, "metadata len %d\n", tmp);
     }
     tmp = atom->size - 8 - (url_ftell(s->pb) - pos);
     if (tmp < 0)
@@ -255,7 +255,7 @@ static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
     if (st->codec->time_base.den)
         pkt->duration = (uint64_t)st->time_base.den*
             st->codec->time_base.num/st->codec->time_base.den;
-    dprintf(s, "pkt dts %lld duration %d\n", pkt->dts, pkt->duration);
+    ff_dprintf(s, "pkt dts %lld duration %d\n", pkt->dts, pkt->duration);
 
     return 0;
 }
@@ -275,17 +275,17 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
     samples = get_be32(s->pb);
 
     tmp = get_be32(s->pb);
-    dprintf(s, "packet num %d\n", tmp);
+    ff_dprintf(s, "packet num %d\n", tmp);
 
     tmp = get_be16(s->pb); // unkown
-    dprintf(s, "unknown %d\n", tmp);
+    ff_dprintf(s, "unknown %d\n", tmp);
 
     tmp  = get_byte(s->pb); // major version
     tmp2 = get_byte(s->pb); // minor version
-    dprintf(s, "version %d.%d\n", tmp, tmp2);
+    ff_dprintf(s, "version %d.%d\n", tmp, tmp2);
 
     tmp = get_be32(s->pb); // unknown
-    dprintf(s, "unknown %d\n", tmp);
+    ff_dprintf(s, "unknown %d\n", tmp);
 
     size = atom->size - 8 - (url_ftell(s->pb) - pos);
     if (size < 0)
@@ -299,7 +299,7 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
     pkt->stream_index = 1;
     pkt->dts = dts;
     pkt->duration = av_rescale(samples, st->time_base.den, st->codec->sample_rate);
-    dprintf(s, "pkt dts %lld duration %d samples %d sample rate %d\n",
+    ff_dprintf(s, "pkt dts %lld duration %d samples %d sample rate %d\n",
             pkt->dts, pkt->duration, samples, st->codec->sample_rate);
 
     return 0;
@@ -356,7 +356,7 @@ static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, i
 
     frame_num = sample_time*st->codec->time_base.den/
         ((int64_t)st->codec->time_base.num*st->time_base.den);
-    dprintf(s, "seek frame num %d timestamp %lld\n", frame_num, sample_time);
+    ff_dprintf(s, "seek frame num %d timestamp %lld\n", frame_num, sample_time);
 
     if (frame_num < r3d->video_offsets_count) {
         url_fseek(s->pb, r3d->video_offsets_count, SEEK_SET);
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 0e2aebb..c18a51f 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -268,9 +268,9 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
     len = url_close_dyn_buf(pb, &buf);
     if ((len > 0) && buf) {
         int result;
-        dprintf(s->ic, "sending %d bytes of RR\n", len);
+        ff_dprintf(s->ic, "sending %d bytes of RR\n", len);
         result= url_write(s->rtp_ctx, buf, len);
-        dprintf(s->ic, "result from url_write: %d\n", result);
+        ff_dprintf(s->ic, "result from url_write: %d\n", result);
         av_free(buf);
     }
     return 0;
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 4453f65..95ea0de 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -171,7 +171,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
     RTPMuxContext *s = s1->priv_data;
     uint32_t rtp_ts;
 
-    dprintf(s1, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
+    ff_dprintf(s1, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
 
     s->last_rtcp_ntp_time = ntp_time;
     rtp_ts = av_rescale_q(ntp_time - s->first_rtcp_ntp_time, (AVRational){1, 1000000},
@@ -194,7 +194,7 @@ void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
 {
     RTPMuxContext *s = s1->priv_data;
 
-    dprintf(s1, "rtp_send_data size=%d\n", len);
+    ff_dprintf(s1, "rtp_send_data size=%d\n", len);
 
     /* build the RTP header */
     put_byte(s1->pb, (RTP_VERSION << 6));
@@ -343,7 +343,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
     int rtcp_bytes;
     int size= pkt->size;
 
-    dprintf(s1, "%d: write len=%d\n", pkt->stream_index, size);
+    ff_dprintf(s1, "%d: write len=%d\n", pkt->stream_index, size);
 
     rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
         RTCP_TX_RATIO_DEN;
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 9316f3c..dfb7d79 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -223,7 +223,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
     struct in_addr sdp_ip;
     int ttl;
 
-    dprintf(s, "sdp: %c='%s'\n", letter, buf);
+    ff_dprintf(s, "sdp: %c='%s'\n", letter, buf);
 
     p = buf;
     if (s1->skip_media && letter != 'm')
@@ -759,7 +759,7 @@ void ff_rtsp_skip_packet(AVFormatContext *s)
         return;
     len = AV_RB16(buf + 1);
 
-    dprintf(s, "skipping RTP packet len=%d\n", len);
+    ff_dprintf(s, "skipping RTP packet len=%d\n", len);
 
     /* skip payload */
     while (len > 0) {
@@ -793,7 +793,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
         for (;;) {
             ret = url_read_complete(rt->rtsp_hd, &ch, 1);
 #ifdef DEBUG_RTP_TCP
-            dprintf(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
+            ff_dprintf(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
 #endif
             if (ret != 1)
                 return -1;
@@ -812,7 +812,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
         }
         *q = '\0';
 
-        dprintf(s, "line='%s'\n", buf);
+        ff_dprintf(s, "line='%s'\n", buf);
 
         /* test if last line */
         if (buf[0] == '\0')
@@ -903,7 +903,7 @@ int ff_rtsp_send_cmd_with_content_async(AVFormatContext *s,
         out_buf = base64buf;
     }
 
-    dprintf(s, "Sending:\n%s--\n", buf);
+    ff_dprintf(s, "Sending:\n%s--\n", buf);
 
     url_write(rt->rtsp_hd_out, out_buf, strlen(out_buf));
     if (send_content_length > 0 && send_content) {
@@ -1703,7 +1703,7 @@ static int tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
     RTSPStream *rtsp_st;
 
 #ifdef DEBUG_RTP_TCP
-    dprintf(s, "tcp_read_packet:\n");
+    ff_dprintf(s, "tcp_read_packet:\n");
 #endif
 redo:
     for (;;) {
@@ -1724,7 +1724,7 @@ redo:
     id  = buf[0];
     len = AV_RB16(buf + 1);
 #ifdef DEBUG_RTP_TCP
-    dprintf(s, "id=%d len=%d\n", id, len);
+    ff_dprintf(s, "id=%d len=%d\n", id, len);
 #endif
     if (len > buf_size || len < 12)
         goto redo;
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 53d2b94..d736e2f 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -114,11 +114,11 @@
 
 /* debug stuff */
 
-/* dprintf macros */
+/* ff_dprintf macros */
 #ifdef DEBUG
-#    define dprintf(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
+#    define ff_dprintf(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
 #else
-#    define dprintf(pctx, ...)
+#    define ff_dprintf(pctx, ...)
 #endif
 
 #define av_abort()      do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
-- 
1.7.1.1




More information about the ffmpeg-devel mailing list