[FFmpeg-cvslog] Replace av_dlog with normal av_log at trace level

Vittorio Giovara git at videolan.org
Mon Apr 20 03:32:09 CEST 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Mar 16 08:57:35 2015 +0000| [1a3eb042c704dea190c644def5b32c9cee8832b8] | committer: Vittorio Giovara

Replace av_dlog with normal av_log at trace level

This applies to every library where performance is not critical.

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

 avplay.c                      |    8 ++--
 libavdevice/dv1394.c          |    4 +-
 libavdevice/fbdev.c           |    2 +-
 libavfilter/avfilter.c        |    4 +-
 libavfilter/internal.h        |    2 +-
 libavfilter/setpts.c          |    2 +-
 libavfilter/vf_crop.c         |    2 +-
 libavfilter/vf_drawtext.c     |    2 +-
 libavfilter/vf_fieldorder.c   |    2 +-
 libavfilter/vsrc_movie.c      |    2 +-
 libavformat/asfdec.c          |   22 +++++------
 libavformat/assdec.c          |    2 +-
 libavformat/avidec.c          |   30 +++++++--------
 libavformat/flvdec.c          |    6 +--
 libavformat/hevc.c            |   44 +++++++++++-----------
 libavformat/http.c            |    6 +--
 libavformat/ipmovie.c         |   74 ++++++++++++++++++------------------
 libavformat/isom.c            |    8 ++--
 libavformat/mmsh.c            |   12 +++---
 libavformat/mmst.c            |   20 +++++-----
 libavformat/mov.c             |   83 +++++++++++++++++++++--------------------
 libavformat/mov_chan.c        |    2 +-
 libavformat/mpeg.c            |    6 +--
 libavformat/mpegenc.c         |    8 ++--
 libavformat/mpegts.c          |   36 +++++++++---------
 libavformat/mpegtsenc.c       |    2 +-
 libavformat/mux.c             |    8 ++--
 libavformat/mxfdec.c          |   36 +++++++++---------
 libavformat/mxfenc.c          |    2 +-
 libavformat/nsvdec.c          |   70 +++++++++++++++++-----------------
 libavformat/oggdec.c          |    8 ++--
 libavformat/r3d.c             |   60 ++++++++++++++---------------
 libavformat/rmdec.c           |    6 +--
 libavformat/rtmpproto.c       |    2 +-
 libavformat/rtpdec.c          |    4 +-
 libavformat/rtpdec_hevc.c     |    8 ++--
 libavformat/rtpenc.c          |    6 +--
 libavformat/rtsp.c            |   10 ++---
 libavformat/rtspdec.c         |   12 +++---
 libavformat/utils.c           |   24 ++++++------
 libavresample/audio_convert.c |    4 +-
 libavresample/audio_mix.c     |    2 +-
 libavresample/resample.c      |    2 +-
 libavresample/utils.c         |   76 ++++++++++++++++++-------------------
 44 files changed, 366 insertions(+), 365 deletions(-)

diff --git a/avplay.c b/avplay.c
index e98e3ad..242b9ae 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1065,7 +1065,7 @@ static double compute_target_time(double frame_current_pts, VideoState *is)
     }
     is->frame_timer += delay;
 
-    av_dlog(NULL, "video: delay=%0.3f pts=%0.3f A-V=%f\n",
+    av_log(NULL, AV_LOG_TRACE, "video: delay=%0.3f pts=%0.3f A-V=%f\n",
             delay, frame_current_pts, -diff);
 
     return is->frame_timer;
@@ -1611,7 +1611,7 @@ static int video_thread(void *arg)
 #if CONFIG_AVFILTER
         if (   last_w != is->video_st->codec->width
             || last_h != is->video_st->codec->height) {
-            av_dlog(NULL, "Changing size %dx%d -> %dx%d\n", last_w, last_h,
+            av_log(NULL, AV_LOG_TRACE, "Changing size %dx%d -> %dx%d\n", last_w, last_h,
                     is->video_st->codec->width, is->video_st->codec->height);
             avfilter_graph_free(&graph);
             graph = avfilter_graph_alloc();
@@ -1640,7 +1640,7 @@ static int video_thread(void *arg)
             if (av_cmp_q(tb, is->video_st->time_base)) {
                 av_unused int64_t pts1 = pts_int;
                 pts_int = av_rescale_q(pts_int, tb, is->video_st->time_base);
-                av_dlog(NULL, "video_thread(): "
+                av_log(NULL, AV_LOG_TRACE, "video_thread(): "
                         "tb:%d/%d pts:%"PRId64" -> tb:%d/%d pts:%"PRId64"\n",
                         tb.num, tb.den, pts1,
                         is->video_st->time_base.num, is->video_st->time_base.den, pts_int);
@@ -1819,7 +1819,7 @@ static int synchronize_audio(VideoState *is, short *samples,
                         samples_size = wanted_size;
                     }
                 }
-                av_dlog(NULL, "diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
+                av_log(NULL, AV_LOG_TRACE, "diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
                         diff, avg_diff, samples_size - samples_size1,
                         is->audio_clock, is->video_clock, is->audio_diff_threshold);
             }
diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c
index d259e1a..addf1ad 100644
--- a/libavdevice/dv1394.c
+++ b/libavdevice/dv1394.c
@@ -160,7 +160,7 @@ restart_poll:
             av_log(context, AV_LOG_ERROR, "Failed to get status: %s\n", strerror(errno));
             return AVERROR(EIO);
         }
-        av_dlog(context, "DV1394: status\n"
+        av_log(context, AV_LOG_TRACE, "DV1394: status\n"
                 "\tactive_frame\t%d\n"
                 "\tfirst_clear_frame\t%d\n"
                 "\tn_clear_frames\t%d\n"
@@ -181,7 +181,7 @@ restart_poll:
         }
     }
 
-    av_dlog(context, "index %d, avail %d, done %d\n", dv->index, dv->avail,
+    av_log(context, AV_LOG_TRACE, "index %d, avail %d, done %d\n", dv->index, dv->avail,
             dv->done);
 
     size = avpriv_dv_produce_packet(dv->dv_demux, pkt,
diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index a83b4f1..27e2ed3 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -199,7 +199,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
     /* wait based on the frame rate */
     curtime = av_gettime();
     delay = fbdev->time_frame - curtime;
-    av_dlog(avctx,
+    av_log(avctx, AV_LOG_TRACE,
             "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
             fbdev->time_frame, curtime, delay);
     if (delay > 0) {
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index fd73cd0..8ede145 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -225,7 +225,7 @@ int avfilter_config_links(AVFilterContext *filter)
 void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
 {
     if (link->type == AVMEDIA_TYPE_VIDEO) {
-        av_dlog(ctx,
+        av_log(ctx, AV_LOG_TRACE,
                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
                 link, link->w, link->h,
                 av_get_pix_fmt_name(link->format),
@@ -236,7 +236,7 @@ void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
         char buf[128];
         av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
 
-        av_dlog(ctx,
+        av_log(ctx, AV_LOG_TRACE,
                 "link[%p r:%d cl:%s fmt:%-16s %-16s->%-16s]%s",
                 link, link->sample_rate, buf,
                 av_get_sample_fmt_name(link->format),
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 6a752dc..4ddedbb 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -145,7 +145,7 @@ void ff_avfilter_default_free_buffer(AVFilterBuffer *buf);
 /** Tell is a format is contained in the provided list terminated by -1. */
 int ff_fmt_is_in(int fmt, const int *fmts);
 
-#define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
+#define FF_DPRINTF_START(ctx, func) av_log(NULL, AV_LOG_TRACE, "%-16s: ", #func)
 
 void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
 
diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c
index fa7a0be..98bafc2 100644
--- a/libavfilter/setpts.c
+++ b/libavfilter/setpts.c
@@ -143,7 +143,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     d = av_expr_eval(setpts->expr, setpts->var_values, NULL);
     frame->pts = D2TS(d);
 
-    av_dlog(inlink->dst,
+    av_log(inlink->dst, AV_LOG_TRACE,
             "n:%"PRId64" interlaced:%d pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n",
             (int64_t)setpts->var_values[VAR_N],
             (int)setpts->var_values[VAR_INTERLACED],
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 9e820d7..4122d52 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -265,7 +265,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
     s->x &= ~((1 << s->hsub) - 1);
     s->y &= ~((1 << s->vsub) - 1);
 
-    av_dlog(ctx, "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n",
+    av_log(ctx, AV_LOG_TRACE, "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n",
             (int)s->var_values[VAR_N], s->var_values[VAR_T], s->x,
             s->y, s->x+s->w, s->y+s->h);
 
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 0befb56..82e805b 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -927,7 +927,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     s->x &= ~((1 << s->hsub) - 1);
     s->y &= ~((1 << s->vsub) - 1);
 
-    av_dlog(ctx, "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n",
+    av_log(ctx, AV_LOG_TRACE, "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n",
             (int)s->var_values[VAR_N], s->var_values[VAR_T],
             s->x, s->y, s->x+s->w, s->y+s->h);
 
diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c
index c05d081..dd4f8cc 100644
--- a/libavfilter/vf_fieldorder.c
+++ b/libavfilter/vf_fieldorder.c
@@ -102,7 +102,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
         return ff_filter_frame(outlink, frame);
     }
 
-    av_dlog(ctx,
+    av_log(ctx, AV_LOG_TRACE,
             "picture will move %s one line\n",
             s->dst_tff ? "up" : "down");
     h = frame->height;
diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c
index 0e5df32..a99be39 100644
--- a/libavfilter/vsrc_movie.c
+++ b/libavfilter/vsrc_movie.c
@@ -222,7 +222,7 @@ static int movie_get_frame(AVFilterLink *outlink)
             if (frame_decoded) {
                 if (movie->frame->pkt_pts != AV_NOPTS_VALUE)
                     movie->frame->pts = movie->frame->pkt_pts;
-                av_dlog(outlink->src,
+                av_log(outlink->src, AV_LOG_TRACE,
                         "movie_get_frame(): file:'%s' pts:%"PRId64" time:%f aspect:%d/%d\n",
                         movie->file_name, movie->frame->pts,
                         (double)movie->frame->pts *
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index fac5806..34e9036 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -114,7 +114,7 @@ static const ff_asf_guid stream_bitrate_guid = { /* (http://get.to/sdp) */
 
 #define PRINT_IF_GUID(g, cmp) \
     if (!ff_guidcmp(g, &cmp)) \
-        av_dlog(NULL, "(GUID: %s) ", # cmp)
+        av_log(NULL, AV_LOG_TRACE, "(GUID: %s) ", # cmp)
 
 static void print_guid(ff_asf_guid *g)
 {
@@ -145,10 +145,10 @@ static void print_guid(ff_asf_guid *g)
     else PRINT_IF_GUID(g, stream_bitrate_guid);
     else PRINT_IF_GUID(g, ff_asf_language_guid);
     else
-        av_dlog(NULL, "(GUID: unknown) ");
+        av_log(NULL, AV_LOG_TRACE, "(GUID: unknown) ");
     for (i = 0; i < 16; i++)
-        av_dlog(NULL, " 0x%02x,", (*g)[i]);
-    av_dlog(NULL, "}\n");
+        av_log(NULL, AV_LOG_TRACE, " 0x%02x,", (*g)[i]);
+    av_log(NULL, AV_LOG_TRACE, "}\n");
 }
 #undef PRINT_IF_GUID
 #else
@@ -658,7 +658,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
 
         if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
             avio_skip(pb, name_len - ret);
-        av_dlog(s, "%d stream %d name_len %2d type %d len %4d <%s>\n",
+        av_log(s, AV_LOG_TRACE, "%d stream %d name_len %2d type %d len %4d <%s>\n",
                 i, stream_num, name_len, value_type, value_len, name);
 
         if (!strcmp(name, "AspectRatioX")){
@@ -824,7 +824,7 @@ static int asf_read_header(AVFormatContext *s)
                           &st->sample_aspect_ratio.den,
                           asf->dar[0].num, asf->dar[0].den, INT_MAX);
 
-            av_dlog(s, "i=%d, st->codec->codec_type:%d, asf->dar %d:%d sar=%d:%d\n",
+            av_log(s, AV_LOG_TRACE, "i=%d, st->codec->codec_type:%d, asf->dar %d:%d sar=%d:%d\n",
                     i, st->codec->codec_type, asf->dar[i].num, asf->dar[i].den,
                     st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
 
@@ -962,7 +962,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
     if (packet_length < asf->hdr.min_pktsize)
         padsize += asf->hdr.min_pktsize - packet_length;
     asf->packet_padsize = padsize;
-    av_dlog(s, "packet: size=%d padsize=%d  left=%d\n",
+    av_log(s, AV_LOG_TRACE, "packet: size=%d padsize=%d  left=%d\n",
             s->packet_size, asf->packet_padsize, asf->packet_size_left);
     return 0;
 }
@@ -985,7 +985,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb)
     DO_2BITS(asf->packet_property >> 4, asf->packet_seq, 0);
     DO_2BITS(asf->packet_property >> 2, asf->packet_frag_offset, 0);
     DO_2BITS(asf->packet_property, asf->packet_replic_size, 0);
-    av_dlog(asf, "key:%d stream:%d seq:%d offset:%d replic_size:%d\n",
+    av_log(asf, AV_LOG_TRACE, "key:%d stream:%d seq:%d offset:%d replic_size:%d\n",
             asf->packet_key_frame, asf->stream_index, asf->packet_seq,
             asf->packet_frag_offset, asf->packet_replic_size);
     if (asf->packet_replic_size >= 8) {
@@ -1112,7 +1112,7 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
         av_assert0(asf_st);
 
         if (!asf_st->frag_offset && asf->packet_frag_offset) {
-            av_dlog(s, "skipping asf data pkt with fragment offset for "
+            av_log(s, AV_LOG_TRACE, "skipping asf data pkt with fragment offset for "
                     "stream:%d, expected:%d but got %d from pkt)\n",
                     asf->stream_index, asf_st->frag_offset,
                     asf->packet_frag_offset);
@@ -1172,7 +1172,7 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
                     asf_st->palette_changed = 0;
                 }
             }
-            av_dlog(asf, "new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
+            av_log(asf, AV_LOG_TRACE, "new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
                     asf->stream_index, asf->packet_key_frame,
                     asf_st->pkt.flags & AV_PKT_FLAG_KEY,
                     s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO,
@@ -1184,7 +1184,7 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
         }
 
         /* read data */
-        av_dlog(asf, "READ PACKET s:%d  os:%d  o:%d,%d  l:%d   DATA:%p\n",
+        av_log(asf, AV_LOG_TRACE, "READ PACKET s:%d  os:%d  o:%d,%d  l:%d   DATA:%p\n",
                 s->packet_size, asf_st->pkt.size, asf->packet_frag_offset,
                 asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data);
         asf->packet_size_left -= asf->packet_frag_size;
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 08c1222..f9f1bdf 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -63,7 +63,7 @@ static int64_t get_pts(const uint8_t *p)
     if (sscanf(p, "%*[^,],%d:%d:%d%*c%d", &hour, &min, &sec, &hsec) != 4)
         return AV_NOPTS_VALUE;
 
-    av_dlog(NULL, "%d %d %d %d [%s]\n", hour, min, sec, hsec, p);
+    av_log(NULL, AV_LOG_TRACE, "%d %d %d %d [%s]\n", hour, min, sec, hsec, p);
 
     min += 60 * hour;
     sec += 60 * min;
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 5c52104..b317b26 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -95,7 +95,7 @@ static int avi_load_index(AVFormatContext *s);
 static int guess_ni_flag(AVFormatContext *s);
 
 #define print_tag(str, tag, size)                        \
-    av_dlog(NULL, "%s: tag=%c%c%c%c size=0x%x\n",        \
+    av_log(NULL, AV_LOG_TRACE, "%s: tag=%c%c%c%c size=0x%x\n",        \
             str, tag & 0xff,                             \
             (tag >> 8) & 0xff,                           \
             (tag >> 16) & 0xff,                          \
@@ -155,7 +155,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num)
     int64_t last_pos = -1;
     int64_t filesize = avi->fsize;
 
-    av_dlog(s,
+    av_log(s, AV_LOG_TRACE,
             "longs_pre_entry:%d index_type:%d entries_in_use:%d "
             "chunk_id:%X base:%16"PRIX64"\n",
             longs_pre_entry,
@@ -196,7 +196,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num)
             int key     = len >= 0;
             len &= 0x7FFFFFFF;
 
-            av_dlog(s, "pos:%"PRId64", len:%X\n", pos, len);
+            av_log(s, AV_LOG_TRACE, "pos:%"PRId64", len:%X\n", pos, len);
 
             if (pb->eof_reached)
                 return AVERROR_INVALIDDATA;
@@ -405,7 +405,7 @@ static int avi_read_header(AVFormatContext *s)
                     avi->movi_end = avi->movi_list + size + (size & 1);
                 else
                     avi->movi_end = avi->fsize;
-                av_dlog(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
+                av_log(NULL, AV_LOG_TRACE, "movi end=%"PRIx64"\n", avi->movi_end);
                 goto end_of_header;
             } else if (tag1 == MKTAG('I', 'N', 'F', 'O'))
                 ff_read_riff_info(s, size - 4);
@@ -549,7 +549,7 @@ static int avi_read_header(AVFormatContext *s)
             avio_rl32(pb); /* quality */
             ast->sample_size = avio_rl32(pb); /* sample ssize */
             ast->cum_len    *= FFMAX(1, ast->sample_size);
-            av_dlog(s, "%"PRIu32" %"PRIu32" %d\n",
+            av_log(s, AV_LOG_TRACE, "%"PRIu32" %"PRIu32" %d\n",
                     ast->rate, ast->scale, ast->sample_size);
 
             switch (tag1) {
@@ -769,7 +769,7 @@ static int avi_read_header(AVFormatContext *s)
                 if (active_aspect.num && active_aspect.den &&
                     active.num && active.den) {
                     st->sample_aspect_ratio = av_div_q(active_aspect, active);
-                    av_dlog(s, "vprp %d/%d %d/%d\n",
+                    av_log(s, AV_LOG_TRACE, "vprp %d/%d %d/%d\n",
                             active_aspect.num, active_aspect.den,
                             active.num, active.den);
                 }
@@ -957,7 +957,7 @@ start_sync:
         size = d[4] + (d[5] << 8) + (d[6] << 16) + (d[7] << 24);
 
         n = get_stream_idx(d + 2);
-        av_dlog(s, "%X %X %X %X %X %X %X %X %"PRId64" %u %d\n",
+        av_log(s, AV_LOG_TRACE, "%X %X %X %X %X %X %X %X %"PRId64" %u %d\n",
                 d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
         if (i + (uint64_t)size > avi->fsize || d[0] > 127)
             continue;
@@ -1114,7 +1114,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
                               (AVRational) { FFMAX(1, ast->sample_size),
                                              AV_TIME_BASE });
 
-            av_dlog(s, "%"PRId64" %d/%d %"PRId64"\n", ts,
+            av_log(s, AV_LOG_TRACE, "%"PRId64" %d/%d %"PRId64"\n", ts,
                     st->time_base.num, st->time_base.den, ast->frame_offset);
             if (ts < best_ts) {
                 best_ts           = ts;
@@ -1224,7 +1224,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 //                pkt->dts += ast->start;
             if (ast->sample_size)
                 pkt->dts /= ast->sample_size;
-            av_dlog(s,
+            av_log(s, AV_LOG_TRACE,
                     "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d "
                     "base:%d st:%d size:%d\n",
                     pkt->dts,
@@ -1297,7 +1297,7 @@ static int avi_read_idx1(AVFormatContext *s, int size)
         flags = avio_rl32(pb);
         pos   = avio_rl32(pb);
         len   = avio_rl32(pb);
-        av_dlog(s, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/",
+        av_log(s, AV_LOG_TRACE, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/",
                 i, tag, flags, pos, len);
 
         index  = ((tag      & 0xff) - '0') * 10;
@@ -1313,7 +1313,7 @@ static int avi_read_idx1(AVFormatContext *s, int size)
         }
         pos += data_offset;
 
-        av_dlog(s, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
+        av_log(s, AV_LOG_TRACE, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
 
         if (pb->eof_reached)
             return AVERROR_INVALIDDATA;
@@ -1433,13 +1433,13 @@ static int avi_load_index(AVFormatContext *s)
 
     if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
         goto the_end; // maybe truncated file
-    av_dlog(s, "movi_end=0x%"PRIx64"\n", avi->movi_end);
+    av_log(s, AV_LOG_TRACE, "movi_end=0x%"PRIx64"\n", avi->movi_end);
     for (;;) {
         if (pb->eof_reached)
             break;
         tag  = avio_rl32(pb);
         size = avio_rl32(pb);
-        av_dlog(s, "tag=%c%c%c%c size=0x%x\n",
+        av_log(s, AV_LOG_TRACE, "tag=%c%c%c%c size=0x%x\n",
                  tag        & 0xff,
                 (tag >>  8) & 0xff,
                 (tag >> 16) & 0xff,
@@ -1505,7 +1505,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index,
     pos       = st->index_entries[index].pos;
     timestamp = st->index_entries[index].timestamp / FFMAX(ast->sample_size, 1);
 
-    av_dlog(s, "XX %"PRId64" %d %"PRId64"\n",
+    av_log(s, AV_LOG_TRACE, "XX %"PRId64" %d %"PRId64"\n",
             timestamp, index, st->index_entries[index].timestamp);
 
     if (CONFIG_DV_DEMUXER && avi->dv_demux) {
@@ -1557,7 +1557,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index,
                 index++;
         }
 
-        av_dlog(s, "%"PRId64" %d %"PRId64"\n",
+        av_log(s, AV_LOG_TRACE, "%"PRId64" %d %"PRId64"\n",
                 timestamp, index, st2->index_entries[index].timestamp);
         /* extract the current frame number */
         ast2->frame_offset = st2->index_entries[index].timestamp;
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index ff86372..eb31a6e 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -750,7 +750,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
         size = avio_rb24(s->pb);
         dts  = avio_rb24(s->pb);
         dts |= avio_r8(s->pb) << 24;
-        av_dlog(s, "type:%d, size:%d, dts:%"PRId64"\n", type, size, dts);
+        av_log(s, AV_LOG_TRACE, "type:%d, size:%d, dts:%"PRId64"\n", type, size, dts);
         if (s->pb->eof_reached)
             return AVERROR_EOF;
         avio_skip(s->pb, 3); /* stream id, always 0 */
@@ -823,7 +823,7 @@ skip:
             if (!st)
                 return AVERROR(ENOMEM);
         }
-        av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard);
+        av_log(s, AV_LOG_TRACE, "%d %X %d \n", is_audio, flags, st->discard);
 
         if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||
             is_audio)
@@ -933,7 +933,7 @@ skip:
                     st->codec->sample_rate = cfg.ext_sample_rate;
                 else
                     st->codec->sample_rate = cfg.sample_rate;
-                av_dlog(s, "mp4a config channels %d sample rate %d\n",
+                av_log(s, AV_LOG_TRACE, "mp4a config channels %d sample rate %d\n",
                         st->codec->channels, st->codec->sample_rate);
             }
 
diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index 37b35b4..4d43b6a 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -849,51 +849,51 @@ static int hvcc_write(AVIOContext *pb, HEVCDecoderConfigurationRecord *hvcc)
     hvcc->avgFrameRate      = 0;
     hvcc->constantFrameRate = 0;
 
-    av_dlog(NULL,  "configurationVersion:                %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "configurationVersion:                %"PRIu8"\n",
             hvcc->configurationVersion);
-    av_dlog(NULL,  "general_profile_space:               %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "general_profile_space:               %"PRIu8"\n",
             hvcc->general_profile_space);
-    av_dlog(NULL,  "general_tier_flag:                   %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "general_tier_flag:                   %"PRIu8"\n",
             hvcc->general_tier_flag);
-    av_dlog(NULL,  "general_profile_idc:                 %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "general_profile_idc:                 %"PRIu8"\n",
             hvcc->general_profile_idc);
-    av_dlog(NULL, "general_profile_compatibility_flags: 0x%08"PRIx32"\n",
+    av_log(NULL, AV_LOG_TRACE, "general_profile_compatibility_flags: 0x%08"PRIx32"\n",
             hvcc->general_profile_compatibility_flags);
-    av_dlog(NULL, "general_constraint_indicator_flags:  0x%012"PRIx64"\n",
+    av_log(NULL, AV_LOG_TRACE, "general_constraint_indicator_flags:  0x%012"PRIx64"\n",
             hvcc->general_constraint_indicator_flags);
-    av_dlog(NULL,  "general_level_idc:                   %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "general_level_idc:                   %"PRIu8"\n",
             hvcc->general_level_idc);
-    av_dlog(NULL,  "min_spatial_segmentation_idc:        %"PRIu16"\n",
+    av_log(NULL, AV_LOG_TRACE,  "min_spatial_segmentation_idc:        %"PRIu16"\n",
             hvcc->min_spatial_segmentation_idc);
-    av_dlog(NULL,  "parallelismType:                     %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "parallelismType:                     %"PRIu8"\n",
             hvcc->parallelismType);
-    av_dlog(NULL,  "chromaFormat:                        %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "chromaFormat:                        %"PRIu8"\n",
             hvcc->chromaFormat);
-    av_dlog(NULL,  "bitDepthLumaMinus8:                  %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "bitDepthLumaMinus8:                  %"PRIu8"\n",
             hvcc->bitDepthLumaMinus8);
-    av_dlog(NULL,  "bitDepthChromaMinus8:                %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "bitDepthChromaMinus8:                %"PRIu8"\n",
             hvcc->bitDepthChromaMinus8);
-    av_dlog(NULL,  "avgFrameRate:                        %"PRIu16"\n",
+    av_log(NULL, AV_LOG_TRACE,  "avgFrameRate:                        %"PRIu16"\n",
             hvcc->avgFrameRate);
-    av_dlog(NULL,  "constantFrameRate:                   %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "constantFrameRate:                   %"PRIu8"\n",
             hvcc->constantFrameRate);
-    av_dlog(NULL,  "numTemporalLayers:                   %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "numTemporalLayers:                   %"PRIu8"\n",
             hvcc->numTemporalLayers);
-    av_dlog(NULL,  "temporalIdNested:                    %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "temporalIdNested:                    %"PRIu8"\n",
             hvcc->temporalIdNested);
-    av_dlog(NULL,  "lengthSizeMinusOne:                  %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "lengthSizeMinusOne:                  %"PRIu8"\n",
             hvcc->lengthSizeMinusOne);
-    av_dlog(NULL,  "numOfArrays:                         %"PRIu8"\n",
+    av_log(NULL, AV_LOG_TRACE,  "numOfArrays:                         %"PRIu8"\n",
             hvcc->numOfArrays);
     for (i = 0; i < hvcc->numOfArrays; i++) {
-        av_dlog(NULL, "array_completeness[%"PRIu8"]:               %"PRIu8"\n",
+        av_log(NULL, AV_LOG_TRACE, "array_completeness[%"PRIu8"]:               %"PRIu8"\n",
                 i, hvcc->array[i].array_completeness);
-        av_dlog(NULL, "NAL_unit_type[%"PRIu8"]:                    %"PRIu8"\n",
+        av_log(NULL, AV_LOG_TRACE, "NAL_unit_type[%"PRIu8"]:                    %"PRIu8"\n",
                 i, hvcc->array[i].NAL_unit_type);
-        av_dlog(NULL, "numNalus[%"PRIu8"]:                         %"PRIu16"\n",
+        av_log(NULL, AV_LOG_TRACE, "numNalus[%"PRIu8"]:                         %"PRIu16"\n",
                 i, hvcc->array[i].numNalus);
         for (j = 0; j < hvcc->array[i].numNalus; j++)
-            av_dlog(NULL,
+            av_log(NULL, AV_LOG_TRACE,
                     "nalUnitLength[%"PRIu8"][%"PRIu16"]:                 %"PRIu16"\n",
                     i, j, hvcc->array[i].nalUnitLength[j]);
     }
diff --git a/libavformat/http.c b/libavformat/http.c
index 23df1b7..3b9aa2d 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -460,7 +460,7 @@ static int process_line(URLContext *h, char *line, int line_count,
             p++;
         s->http_code = strtol(p, &end, 10);
 
-        av_dlog(NULL, "http_code=%d\n", s->http_code);
+        av_log(NULL, AV_LOG_TRACE, "http_code=%d\n", s->http_code);
 
         if ((ret = check_http_code(h, s->http_code, end)) < 0)
             return ret;
@@ -535,7 +535,7 @@ static int http_read_header(URLContext *h, int *new_location)
         if ((err = http_get_line(s, line, sizeof(line))) < 0)
             return err;
 
-        av_dlog(NULL, "header='%s'\n", line);
+        av_log(NULL, AV_LOG_TRACE, "header='%s'\n", line);
 
         err = process_line(h, line, s->line_count, new_location);
         if (err < 0)
@@ -775,7 +775,7 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size)
 
                 s->chunksize = strtoll(line, NULL, 16);
 
-                av_dlog(NULL, "Chunked encoding data size: %"PRId64"'\n",
+                av_log(NULL, AV_LOG_TRACE, "Chunked encoding data size: %"PRId64"'\n",
                         s->chunksize);
 
                 if (!s->chunksize)
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 60ae939..fe8d97b 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -147,7 +147,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
             s->audio_frame_count +=
                 (s->audio_chunk_size - 6 - s->audio_channels) / s->audio_channels;
 
-        av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
+        av_log(NULL, AV_LOG_TRACE, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
                 pkt->pts, s->audio_frame_count);
 
         chunk_type = CHUNK_VIDEO;
@@ -196,7 +196,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
         pkt->stream_index = s->video_stream_index;
         pkt->pts = s->video_pts;
 
-        av_dlog(NULL, "sending video frame with pts %"PRId64"\n", pkt->pts);
+        av_log(NULL, AV_LOG_TRACE, "sending video frame with pts %"PRId64"\n", pkt->pts);
 
         s->video_pts += s->frame_pts_inc;
 
@@ -245,36 +245,36 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
     chunk_size = AV_RL16(&chunk_preamble[0]);
     chunk_type = AV_RL16(&chunk_preamble[2]);
 
-    av_dlog(NULL, "chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
+    av_log(NULL, AV_LOG_TRACE, "chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
 
     switch (chunk_type) {
 
     case CHUNK_INIT_AUDIO:
-        av_dlog(NULL, "initialize audio\n");
+        av_log(NULL, AV_LOG_TRACE, "initialize audio\n");
         break;
 
     case CHUNK_AUDIO_ONLY:
-        av_dlog(NULL, "audio only\n");
+        av_log(NULL, AV_LOG_TRACE, "audio only\n");
         break;
 
     case CHUNK_INIT_VIDEO:
-        av_dlog(NULL, "initialize video\n");
+        av_log(NULL, AV_LOG_TRACE, "initialize video\n");
         break;
 
     case CHUNK_VIDEO:
-        av_dlog(NULL, "video (and audio)\n");
+        av_log(NULL, AV_LOG_TRACE, "video (and audio)\n");
         break;
 
     case CHUNK_SHUTDOWN:
-        av_dlog(NULL, "shutdown\n");
+        av_log(NULL, AV_LOG_TRACE, "shutdown\n");
         break;
 
     case CHUNK_END:
-        av_dlog(NULL, "end\n");
+        av_log(NULL, AV_LOG_TRACE, "end\n");
         break;
 
     default:
-        av_dlog(NULL, "invalid chunk\n");
+        av_log(NULL, AV_LOG_TRACE, "invalid chunk\n");
         chunk_type = CHUNK_BAD;
         break;
 
@@ -300,29 +300,29 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
         chunk_size -= OPCODE_PREAMBLE_SIZE;
         chunk_size -= opcode_size;
         if (chunk_size < 0) {
-            av_dlog(NULL, "chunk_size countdown just went negative\n");
+            av_log(NULL, AV_LOG_TRACE, "chunk_size countdown just went negative\n");
             chunk_type = CHUNK_BAD;
             break;
         }
 
-        av_dlog(NULL, "  opcode type %02X, version %d, 0x%04X bytes: ",
+        av_log(NULL, AV_LOG_TRACE, "  opcode type %02X, version %d, 0x%04X bytes: ",
                 opcode_type, opcode_version, opcode_size);
         switch (opcode_type) {
 
         case OPCODE_END_OF_STREAM:
-            av_dlog(NULL, "end of stream\n");
+            av_log(NULL, AV_LOG_TRACE, "end of stream\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_END_OF_CHUNK:
-            av_dlog(NULL, "end of chunk\n");
+            av_log(NULL, AV_LOG_TRACE, "end of chunk\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_CREATE_TIMER:
-            av_dlog(NULL, "create timer\n");
+            av_log(NULL, AV_LOG_TRACE, "create timer\n");
             if ((opcode_version > 0) || (opcode_size > 6)) {
-                av_dlog(NULL, "bad create_timer opcode\n");
+                av_log(NULL, AV_LOG_TRACE, "bad create_timer opcode\n");
                 chunk_type = CHUNK_BAD;
                 break;
             }
@@ -332,15 +332,15 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
                 break;
             }
             s->frame_pts_inc = ((uint64_t)AV_RL32(&scratch[0])) * AV_RL16(&scratch[4]);
-            av_dlog(NULL, "  %.2f frames/second (timer div = %d, subdiv = %d)\n",
+            av_log(NULL, AV_LOG_TRACE, "  %.2f frames/second (timer div = %d, subdiv = %d)\n",
                     1000000.0 / s->frame_pts_inc, AV_RL32(&scratch[0]),
                     AV_RL16(&scratch[4]));
             break;
 
         case OPCODE_INIT_AUDIO_BUFFERS:
-            av_dlog(NULL, "initialize audio buffers\n");
+            av_log(NULL, AV_LOG_TRACE, "initialize audio buffers\n");
             if ((opcode_version > 1) || (opcode_size > 10)) {
-                av_dlog(NULL, "bad init_audio_buffers opcode\n");
+                av_log(NULL, AV_LOG_TRACE, "bad init_audio_buffers opcode\n");
                 chunk_type = CHUNK_BAD;
                 break;
             }
@@ -362,7 +362,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
                 s->audio_type = AV_CODEC_ID_PCM_S16LE;
             else
                 s->audio_type = AV_CODEC_ID_PCM_U8;
-            av_dlog(NULL, "audio: %d bits, %d Hz, %s, %s format\n",
+            av_log(NULL, AV_LOG_TRACE, "audio: %d bits, %d Hz, %s, %s format\n",
                     s->audio_bits, s->audio_sample_rate,
                     (s->audio_channels == 2) ? "stereo" : "mono",
                     (s->audio_type == AV_CODEC_ID_INTERPLAY_DPCM) ?
@@ -370,14 +370,14 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
             break;
 
         case OPCODE_START_STOP_AUDIO:
-            av_dlog(NULL, "start/stop audio\n");
+            av_log(NULL, AV_LOG_TRACE, "start/stop audio\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_INIT_VIDEO_BUFFERS:
-            av_dlog(NULL, "initialize video buffers\n");
+            av_log(NULL, AV_LOG_TRACE, "initialize video buffers\n");
             if ((opcode_version > 2) || (opcode_size > 8)) {
-                av_dlog(NULL, "bad init_video_buffers opcode\n");
+                av_log(NULL, AV_LOG_TRACE, "bad init_video_buffers opcode\n");
                 chunk_type = CHUNK_BAD;
                 break;
             }
@@ -401,7 +401,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
             } else {
                 s->video_bpp = 16;
             }
-            av_dlog(NULL, "video resolution: %d x %d\n",
+            av_log(NULL, AV_LOG_TRACE, "video resolution: %d x %d\n",
                     s->video_width, s->video_height);
             break;
 
@@ -412,17 +412,17 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
         case OPCODE_UNKNOWN_13:
         case OPCODE_UNKNOWN_14:
         case OPCODE_UNKNOWN_15:
-            av_dlog(NULL, "unknown (but documented) opcode %02X\n", opcode_type);
+            av_log(NULL, AV_LOG_TRACE, "unknown (but documented) opcode %02X\n", opcode_type);
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_SEND_BUFFER:
-            av_dlog(NULL, "send buffer\n");
+            av_log(NULL, AV_LOG_TRACE, "send buffer\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_AUDIO_FRAME:
-            av_dlog(NULL, "audio frame\n");
+            av_log(NULL, AV_LOG_TRACE, "audio frame\n");
 
             /* log position and move on for now */
             s->audio_chunk_offset = avio_tell(pb);
@@ -431,26 +431,26 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
             break;
 
         case OPCODE_SILENCE_FRAME:
-            av_dlog(NULL, "silence frame\n");
+            av_log(NULL, AV_LOG_TRACE, "silence frame\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_INIT_VIDEO_MODE:
-            av_dlog(NULL, "initialize video mode\n");
+            av_log(NULL, AV_LOG_TRACE, "initialize video mode\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_CREATE_GRADIENT:
-            av_dlog(NULL, "create gradient\n");
+            av_log(NULL, AV_LOG_TRACE, "create gradient\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_SET_PALETTE:
-            av_dlog(NULL, "set palette\n");
+            av_log(NULL, AV_LOG_TRACE, "set palette\n");
             /* check for the logical maximum palette size
              * (3 * 256 + 4 bytes) */
             if (opcode_size > 0x304) {
-                av_dlog(NULL, "demux_ipmovie: set_palette opcode too large\n");
+                av_log(NULL, AV_LOG_TRACE, "demux_ipmovie: set_palette opcode too large\n");
                 chunk_type = CHUNK_BAD;
                 break;
             }
@@ -464,7 +464,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
             last_color = first_color + AV_RL16(&scratch[2]) - 1;
             /* sanity check (since they are 16 bit values) */
             if ((first_color > 0xFF) || (last_color > 0xFF)) {
-                av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
+                av_log(NULL, AV_LOG_TRACE, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
                     first_color, last_color);
                 chunk_type = CHUNK_BAD;
                 break;
@@ -482,12 +482,12 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
             break;
 
         case OPCODE_SET_PALETTE_COMPRESSED:
-            av_dlog(NULL, "set palette compressed\n");
+            av_log(NULL, AV_LOG_TRACE, "set palette compressed\n");
             avio_skip(pb, opcode_size);
             break;
 
         case OPCODE_SET_DECODING_MAP:
-            av_dlog(NULL, "set decoding map\n");
+            av_log(NULL, AV_LOG_TRACE, "set decoding map\n");
 
             /* log position and move on for now */
             s->decode_map_chunk_offset = avio_tell(pb);
@@ -496,7 +496,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
             break;
 
         case OPCODE_VIDEO_DATA:
-            av_dlog(NULL, "set video data\n");
+            av_log(NULL, AV_LOG_TRACE, "set video data\n");
 
             /* log position and move on for now */
             s->video_chunk_offset = avio_tell(pb);
@@ -505,7 +505,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
             break;
 
         default:
-            av_dlog(NULL, "*** unknown opcode type\n");
+            av_log(NULL, AV_LOG_TRACE, "*** unknown opcode type\n");
             chunk_type = CHUNK_BAD;
             break;
 
diff --git a/libavformat/isom.c b/libavformat/isom.c
index e6cd263..f8cc4b2 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -404,7 +404,7 @@ int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag)
     int len;
     *tag = avio_r8(pb);
     len = ff_mp4_read_descr_len(pb);
-    av_dlog(fc, "MPEG4 description: tag=0x%02x len=%d\n", *tag, len);
+    av_log(fc, AV_LOG_TRACE, "MPEG4 description: tag=0x%02x len=%d\n", *tag, len);
     return len;
 }
 
@@ -443,10 +443,10 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
     avio_rb32(pb); /* avg bitrate */
 
     st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
-    av_dlog(fc, "esds object type id 0x%02x\n", object_type_id);
+    av_log(fc, AV_LOG_TRACE, "esds object type id 0x%02x\n", object_type_id);
     len = ff_mp4_read_descr(fc, pb, &tag);
     if (tag == MP4DecSpecificDescrTag) {
-        av_dlog(fc, "Specific MPEG4 header len=%d\n", len);
+        av_log(fc, AV_LOG_TRACE, "Specific MPEG4 header len=%d\n", len);
         if (!len || (uint64_t)len > (1<<30))
             return -1;
         av_free(st->codec->extradata);
@@ -466,7 +466,7 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
                 st->codec->sample_rate = cfg.ext_sample_rate;
             else
                 st->codec->sample_rate = cfg.sample_rate;
-            av_dlog(fc, "mp4a config channels %d obj %d ext obj %d "
+            av_log(fc, AV_LOG_TRACE, "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);
diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index f8803a5..9a40002 100644
--- a/libavformat/mmsh.c
+++ b/libavformat/mmsh.c
@@ -123,7 +123,7 @@ static int read_data_packet(MMSHContext *mmsh, const int len)
         return AVERROR(EIO);
     }
     res = ffurl_read_complete(mms->mms_hd, mms->in_buffer, len);
-    av_dlog(NULL, "Data packet len = %d\n", len);
+    av_log(NULL, AV_LOG_TRACE, "Data packet len = %d\n", len);
     if (res != len) {
         av_log(NULL, AV_LOG_ERROR, "Read data packet failed!\n");
         return AVERROR(EIO);
@@ -157,7 +157,7 @@ static int get_http_header_data(MMSHContext *mmsh)
                 if (mms->asf_header) {
                     if (len != mms->asf_header_size) {
                         mms->asf_header_size = len;
-                        av_dlog(NULL, "Header len changed from %d to %d\n",
+                        av_log(NULL, AV_LOG_TRACE, "Header len changed from %d to %d\n",
                                 mms->asf_header_size, len);
                         av_freep(&mms->asf_header);
                     }
@@ -202,7 +202,7 @@ static int get_http_header_data(MMSHContext *mmsh)
                     av_log(NULL, AV_LOG_ERROR, "Read other chunk type data failed!\n");
                     return AVERROR(EIO);
                 } else {
-                    av_dlog(NULL, "Skip chunk type %d \n", chunk_type);
+                    av_log(NULL, AV_LOG_TRACE, "Skip chunk type %d \n", chunk_type);
                     continue;
                 }
             }
@@ -289,7 +289,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
         av_log(NULL, AV_LOG_ERROR, "Build play request failed!\n");
         goto fail;
     }
-    av_dlog(NULL, "out_buffer is %s", headers);
+    av_log(NULL, AV_LOG_TRACE, "out_buffer is %s", headers);
     av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0);
 
     err = ffurl_connect(mms->mms_hd, NULL);
@@ -303,12 +303,12 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
         goto fail;
     }
 
-    av_dlog(NULL, "Connection successfully open\n");
+    av_log(NULL, AV_LOG_TRACE, "Connection successfully open\n");
     return 0;
 fail:
     av_freep(&stream_selection);
     mmsh_close(h);
-    av_dlog(NULL, "Connection failed with error %d\n", err);
+    av_log(NULL, AV_LOG_TRACE, "Connection failed with error %d\n", err);
     return err;
 }
 
diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index d45f7ba..b2d9a0d 100644
--- a/libavformat/mmst.c
+++ b/libavformat/mmst.c
@@ -208,11 +208,11 @@ static int send_media_file_request(MMSTContext *mmst)
 static void handle_packet_stream_changing_type(MMSTContext *mmst)
 {
     MMSContext *mms = &mmst->mms;
-    av_dlog(NULL, "Stream changing!\n");
+    av_log(NULL, AV_LOG_TRACE, "Stream changing!\n");
 
     // 40 is the packet header size, 7 is the prefix size.
     mmst->header_packet_id= AV_RL32(mms->in_buffer + 40 + 7);
-    av_dlog(NULL, "Changed header prefix to 0x%x", mmst->header_packet_id);
+    av_log(NULL, AV_LOG_TRACE, "Changed header prefix to 0x%x", mmst->header_packet_id);
 }
 
 static int send_keepalive_packet(MMSTContext *mmst)
@@ -272,7 +272,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
             }
 
             length_remaining= AV_RL32(mms->in_buffer+8) + 4;
-            av_dlog(NULL, "Length remaining is %d\n", length_remaining);
+            av_log(NULL, AV_LOG_TRACE, "Length remaining is %d\n", length_remaining);
             // read the rest of the packet.
             if (length_remaining < 0
                 || length_remaining > sizeof(mms->in_buffer) - 12) {
@@ -351,7 +351,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
             } else if(packet_id_type == mmst->packet_id) {
                 packet_type = SC_PKT_ASF_MEDIA;
             } else {
-                av_dlog(NULL, "packet id type %d is old.", packet_id_type);
+                av_log(NULL, AV_LOG_TRACE, "packet id type %d is old.", packet_id_type);
                 continue;
             }
         }
@@ -377,7 +377,7 @@ static int mms_safe_send_recv(MMSTContext *mmst,
     if(send_fun) {
         int ret = send_fun(mmst);
         if (ret < 0) {
-            av_dlog(NULL, "Send Packet error before expecting recv packet %d\n", expect_type);
+            av_log(NULL, AV_LOG_TRACE, "Send Packet error before expecting recv packet %d\n", expect_type);
             return ret;
         }
     }
@@ -552,7 +552,7 @@ static int mms_open(URLContext *h, const char *uri, int flags)
     }
     err = ff_mms_asf_header_parser(mms);
     if (err) {
-        av_dlog(NULL, "asf header parsed failed!\n");
+        av_log(NULL, AV_LOG_TRACE, "asf header parsed failed!\n");
         goto fail;
     }
     mms->header_parsed = 1;
@@ -569,11 +569,11 @@ static int mms_open(URLContext *h, const char *uri, int flags)
     if (err) {
         goto fail;
     }
-    av_dlog(NULL, "Leaving open (success)\n");
+    av_log(NULL, AV_LOG_TRACE, "Leaving open (success)\n");
     return 0;
 fail:
     mms_close(h);
-    av_dlog(NULL, "Leaving open (failure: %d)\n", err);
+    av_log(NULL, AV_LOG_TRACE, "Leaving open (failure: %d)\n", err);
     return err;
 }
 
@@ -606,12 +606,12 @@ static int mms_read(URLContext *h, uint8_t *buf, int size)
                     // copy the data to the packet buffer.
                     result = ff_mms_read_data(mms, buf, size);
                     if (result == 0) {
-                        av_dlog(NULL, "Read ASF media packet size is zero!\n");
+                        av_log(NULL, AV_LOG_TRACE, "Read ASF media packet size is zero!\n");
                         break;
                     }
                 }
             } else {
-                av_dlog(NULL, "read packet error!\n");
+                av_log(NULL, AV_LOG_TRACE, "read packet error!\n");
                 break;
             }
         }
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 72dd699..98822af 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -404,8 +404,8 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             av_dict_set(&c->fc->metadata, key2, str, 0);
         }
     }
-    av_dlog(c->fc, "lang \"%3s\" ", language);
-    av_dlog(c->fc, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n",
+    av_log(c->fc, AV_LOG_TRACE, "lang \"%3s\" ", language);
+    av_log(c->fc, AV_LOG_TRACE, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n",
             key, str, (char*)&atom.type, str_size_alloc, atom.size);
 
     av_freep(&str);
@@ -477,7 +477,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
         dref->type = avio_rl32(pb);
         avio_rb32(pb); // version + flags
-        av_dlog(c->fc, "type %.4s size %d\n", (char*)&dref->type, size);
+        av_log(c->fc, AV_LOG_TRACE, "type %.4s size %d\n", (char*)&dref->type, size);
 
         if (dref->type == MKTAG('a','l','i','s') && size > 150) {
             /* macintosh alias record */
@@ -573,8 +573,8 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     ctype = avio_rl32(pb);
     type = avio_rl32(pb); /* component subtype */
 
-    av_dlog(c->fc, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
-    av_dlog(c->fc, "stype= %.4s\n", (char*)&type);
+    av_log(c->fc, AV_LOG_TRACE, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
+    av_log(c->fc, AV_LOG_TRACE, "stype= %.4s\n", (char*)&type);
 
     if     (type == MKTAG('v','i','d','e'))
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@@ -811,7 +811,7 @@ static int mov_read_moov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     c->fragment.moof_offset = c->fragment.implicit_offset = avio_tell(pb) - 8;
-    av_dlog(c->fc, "moof offset %"PRIx64"\n", c->fragment.moof_offset);
+    av_log(c->fc, AV_LOG_TRACE, "moof offset %"PRIx64"\n", c->fragment.moof_offset);
     return mov_read_default(c, pb, atom);
 }
 
@@ -889,7 +889,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     mov_metadata_creation_time(&c->fc->metadata, creation_time);
     c->time_scale = avio_rb32(pb); /* time scale */
 
-    av_dlog(c->fc, "time scale = %i\n", c->time_scale);
+    av_log(c->fc, AV_LOG_TRACE, "time scale = %i\n", c->time_scale);
 
     c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
     avio_rb32(pb); /* preferred scale */
@@ -931,7 +931,7 @@ static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     st->codec->extradata_size = 0x5a + atom.size;
     memcpy(st->codec->extradata, "SVQ3", 4); // fake
     avio_read(pb, st->codec->extradata + 0x5a, atom.size);
-    av_dlog(c->fc, "Reading SMI %"PRId64"  %s\n", atom.size, st->codec->extradata + 0x5a);
+    av_log(c->fc, AV_LOG_TRACE, "Reading SMI %"PRId64"  %s\n", atom.size, st->codec->extradata + 0x5a);
     return 0;
 }
 
@@ -945,7 +945,7 @@ static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     st = c->fc->streams[c->fc->nb_streams-1];
 
     little_endian = !!avio_rb16(pb);
-    av_dlog(c->fc, "enda %d\n", little_endian);
+    av_log(c->fc, AV_LOG_TRACE, "enda %d\n", little_endian);
     if (little_endian == 1) {
         switch (st->codec->codec_id) {
         case AV_CODEC_ID_PCM_S24BE:
@@ -989,12 +989,13 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     color_trc = avio_rb16(pb);
     color_matrix = avio_rb16(pb);
 
-    av_dlog(c->fc, "%s: pri %"PRIu16" trc %"PRIu16" matrix %"PRIu16"",
-            color_parameter_type, color_primaries, color_trc, color_matrix);
+    av_log(c->fc, AV_LOG_TRACE,
+           "%s: pri %"PRIu16" trc %"PRIu16" matrix %"PRIu16"",
+           color_parameter_type, color_primaries, color_trc, color_matrix);
 
     if (!strncmp(color_parameter_type, "nclx", 4)) {
         uint8_t color_range = avio_r8(pb) >> 7;
-        av_dlog(c->fc, " full %"PRIu8"", color_range);
+        av_log(c->fc, AV_LOG_TRACE, " full %"PRIu8"", color_range);
         if (color_range)
             st->codec->color_range = AVCOL_RANGE_JPEG;
         else
@@ -1031,7 +1032,7 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         case 7: st->codec->colorspace = AVCOL_SPC_SMPTE240M; break;
         }
     }
-    av_dlog(c->fc, "\n");
+    av_log(c->fc, AV_LOG_TRACE, "\n");
 
     return 0;
 }
@@ -1341,7 +1342,7 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
 
     st->codec->bits_per_coded_sample = avio_rb16(pb); /* depth */
     color_table_id = avio_rb16(pb); /* colortable id */
-    av_dlog(c->fc, "depth %d, ctab id %d\n",
+    av_log(c->fc, AV_LOG_TRACE, "depth %d, ctab id %d\n",
             st->codec->bits_per_coded_sample, color_table_id);
     /* figure out the palette situation */
     color_depth     = st->codec->bits_per_coded_sample & 0x1F;
@@ -1421,7 +1422,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
 
     st->codec->channels              = avio_rb16(pb); /* channel count */
     st->codec->bits_per_coded_sample = avio_rb16(pb); /* sample size */
-    av_dlog(c->fc, "audio channels %d\n", st->codec->channels);
+    av_log(c->fc, AV_LOG_TRACE, "audio channels %d\n", st->codec->channels);
 
     sc->audio_cid = avio_rb16(pb);
     avio_rb16(pb); /* packet size = 0 */
@@ -1429,7 +1430,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
     st->codec->sample_rate = ((avio_rb32(pb) >> 16));
 
     // Read QT version 1 fields. In version 0 these do not exist.
-    av_dlog(c->fc, "version =%d, isom =%d\n", version, c->isom);
+    av_log(c->fc, AV_LOG_TRACE, "version =%d, isom =%d\n", version, c->isom);
     if (!c->isom) {
         if (version == 1) {
             sc->samples_per_frame = avio_rb32(pb);
@@ -1707,7 +1708,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
 
         id = mov_codec_id(st, format);
 
-        av_dlog(c->fc, "size=%"PRIu32" 4CC= %"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8" codec_type=%d\n", size,
+        av_log(c->fc, AV_LOG_TRACE, "size=%"PRIu32" 4CC= %"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8" codec_type=%d\n", size,
                 (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
                 (format >> 24) & 0xff, st->codec->codec_type);
 
@@ -1769,7 +1770,7 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     entries = avio_rb32(pb);
 
-    av_dlog(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
+    av_log(c->fc, AV_LOG_TRACE, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
 
     if (!entries)
         return 0;
@@ -1815,7 +1816,7 @@ static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     for (i = 0; i < entries && !pb->eof_reached; i++) {
         sc->stps_data[i] = avio_rb32(pb);
-        //av_dlog(c->fc, "stps %d\n", sc->stps_data[i]);
+        //av_log(c->fc, AV_LOG_TRACE, "stps %d\n", sc->stps_data[i]);
     }
 
     sc->stps_count = i;
@@ -1842,7 +1843,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     entries = avio_rb32(pb);
 
-    av_dlog(c->fc, "keyframe_count = %d\n", entries);
+    av_log(c->fc, AV_LOG_TRACE, "keyframe_count = %d\n", entries);
 
     if (!entries)
     {
@@ -1858,7 +1859,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     for (i = 0; i < entries && !pb->eof_reached; i++) {
         sc->keyframes[i] = avio_rb32(pb);
-        //av_dlog(c->fc, "keyframes[]=%d\n", sc->keyframes[i]);
+        //av_log(c->fc, AV_LOG_TRACE, "keyframes[]=%d\n", sc->keyframes[i]);
     }
 
     sc->keyframe_count = i;
@@ -1897,7 +1898,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     }
     entries = avio_rb32(pb);
 
-    av_dlog(c->fc, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
+    av_log(c->fc, AV_LOG_TRACE, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
 
     sc->sample_count = entries;
     if (sample_size)
@@ -1963,7 +1964,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_rb24(pb); /* flags */
     entries = avio_rb32(pb);
 
-    av_dlog(c->fc, "track[%i].stts.entries = %i\n",
+    av_log(c->fc, AV_LOG_TRACE, "track[%i].stts.entries = %i\n",
             c->fc->nb_streams-1, entries);
 
     if (!entries)
@@ -1989,7 +1990,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         sc->stts_data[i].count= sample_count;
         sc->stts_data[i].duration= sample_duration;
 
-        av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n",
+        av_log(c->fc, AV_LOG_TRACE, "sample_count=%d, sample_duration=%d\n",
                 sample_count, sample_duration);
 
         duration+=(int64_t)sample_duration*sample_count;
@@ -2023,7 +2024,7 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_rb24(pb); /* flags */
     entries = avio_rb32(pb);
 
-    av_dlog(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
+    av_log(c->fc, AV_LOG_TRACE, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
 
     if (!entries)
         return 0;
@@ -2048,7 +2049,7 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     if (pb->eof_reached)
         return AVERROR_EOF;
 
-    av_dlog(c->fc, "dts shift %d\n", sc->dts_shift);
+    av_log(c->fc, AV_LOG_TRACE, "dts shift %d\n", sc->dts_shift);
 
     return 0;
 }
@@ -2185,7 +2186,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                     e->size = sample_size;
                     e->min_distance = distance;
                     e->flags = keyframe ? AVINDEX_KEYFRAME : 0;
-                    av_dlog(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
+                    av_log(mov->fc, AV_LOG_TRACE, "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);
                 }
@@ -2234,7 +2235,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
             total += chunk_count * count;
         }
 
-        av_dlog(mov->fc, "chunk count %d\n", total);
+        av_log(mov->fc, AV_LOG_TRACE, "chunk count %d\n", total);
         if (total >= UINT_MAX / sizeof(*st->index_entries) - st->nb_index_entries)
             return;
         if (av_reallocp_array(&st->index_entries,
@@ -2281,7 +2282,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                 e->size = size;
                 e->min_distance = 0;
                 e->flags = AVINDEX_KEYFRAME;
-                av_dlog(mov->fc, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
+                av_log(mov->fc, AV_LOG_TRACE, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
                         "size %d, duration %d\n", st->index, i, current_offset, current_dts,
                         size, samples);
 
@@ -2662,7 +2663,7 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
                      avio_rb32(pb) : trex->size;
     frag->flags    = flags & MOV_TFHD_DEFAULT_FLAGS ?
                      avio_rb32(pb) : trex->flags;
-    av_dlog(c->fc, "frag flags 0x%x\n", frag->flags);
+    av_log(c->fc, AV_LOG_TRACE, "frag flags 0x%x\n", frag->flags);
     return 0;
 }
 
@@ -2753,7 +2754,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_r8(pb); /* version */
     flags = avio_rb24(pb);
     entries = avio_rb32(pb);
-    av_dlog(c->fc, "flags 0x%x entries %d\n", flags, entries);
+    av_log(c->fc, AV_LOG_TRACE, "flags 0x%x entries %d\n", flags, entries);
 
     /* Always assume the presence of composition time offsets.
      * Without this assumption, for instance, we cannot deal with a track in fragmented movies that meet the following.
@@ -2783,7 +2784,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     dts    = sc->track_end - sc->time_offset;
     offset = frag->base_data_offset + data_offset;
     distance = 0;
-    av_dlog(c->fc, "first sample flags 0x%x\n", first_sample_flags);
+    av_log(c->fc, AV_LOG_TRACE, "first sample flags 0x%x\n", first_sample_flags);
     for (i = 0; i < entries && !pb->eof_reached; i++) {
         unsigned sample_size = frag->size;
         int sample_flags = i ? frag->flags : first_sample_flags;
@@ -2807,7 +2808,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             distance = 0;
         av_add_index_entry(st, offset, dts, sample_size, distance,
                            keyframe ? AVINDEX_KEYFRAME : 0);
-        av_dlog(c->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
+        av_log(c->fc, AV_LOG_TRACE, "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++;
@@ -2932,7 +2933,7 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         av_log(c->fc, AV_LOG_WARNING, "multiple edit list entries, "
                "a/v desync might occur, patch welcome\n");
 
-    av_dlog(c->fc, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
+    av_log(c->fc, AV_LOG_TRACE, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
     return 0;
 }
 
@@ -3017,7 +3018,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             a.size = avio_rb32(pb);
             a.type = avio_rl32(pb);
         }
-        av_dlog(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
+        av_log(c->fc, AV_LOG_TRACE, "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 */
@@ -3258,7 +3259,7 @@ static int mov_read_header(AVFormatContext *s)
         mov_read_close(s);
         return AVERROR_INVALIDDATA;
     }
-    av_dlog(mov->fc, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb));
+    av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb));
 
     if (pb->seekable && mov->chapter_track > 0)
         mov_read_chapters(s);
@@ -3336,7 +3337,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);
-            av_dlog(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
+            av_log(s, AV_LOG_TRACE, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
             if (!sample || (!s->pb->seekable && current_sample->pos < sample->pos) ||
                 (s->pb->seekable &&
                  ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
@@ -3369,7 +3370,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
         if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
             s->pb->eof_reached)
             return AVERROR_EOF;
-        av_dlog(s, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
+        av_log(s, AV_LOG_TRACE, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
         goto retry;
     }
     sc = st->priv_data;
@@ -3431,7 +3432,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;
-    av_dlog(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n",
+    av_log(s, AV_LOG_TRACE, "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;
 }
@@ -3443,13 +3444,13 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
     int i;
 
     sample = av_index_search_timestamp(st, timestamp, flags);
-    av_dlog(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
+    av_log(s, AV_LOG_TRACE, "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 AVERROR_INVALIDDATA;
     sc->current_sample = sample;
-    av_dlog(s, "stream %d, found sample %d\n", st->index, sc->current_sample);
+    av_log(s, AV_LOG_TRACE, "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/mov_chan.c b/libavformat/mov_chan.c
index aa7ba10..2c54920 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -556,7 +556,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
     bitmap     = avio_rb32(pb);
     num_descr  = avio_rb32(pb);
 
-    av_dlog(s, "chan: layout=%u bitmap=%u num_descr=%u\n",
+    av_log(s, AV_LOG_TRACE, "chan: layout=%u bitmap=%u num_descr=%u\n",
             layout_tag, bitmap, num_descr);
 
     if (size < 12ULL + num_descr * 20ULL)
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 7c87517..ffabe28 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -530,7 +530,7 @@ found:
     pkt->dts          = dts;
     pkt->pos          = dummy_pos;
     pkt->stream_index = st->index;
-    av_dlog(s, "%d: pts=%0.3f dts=%0.3f size=%d\n",
+    av_log(s, AV_LOG_TRACE, "%d: pts=%0.3f dts=%0.3f size=%d\n",
             pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0,
             pkt->size);
 
@@ -550,7 +550,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
     for (;;) {
         len = mpegps_read_pes_header(s, &pos, &startcode, &pts, &dts);
         if (len < 0) {
-            av_dlog(s, "none (ret=%d)\n", len);
+            av_log(s, AV_LOG_TRACE, "none (ret=%d)\n", len);
             return AV_NOPTS_VALUE;
         }
         if (startcode == s->streams[stream_index]->id &&
@@ -559,7 +559,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
         }
         avio_skip(s->pb, len);
     }
-    av_dlog(s, "pos=0x%"PRIx64" dts=0x%"PRIx64" %0.3f\n",
+    av_log(s, AV_LOG_TRACE, "pos=0x%"PRIx64" dts=0x%"PRIx64" %0.3f\n",
             pos, dts, dts / 90000.0);
     *ppos = pos;
     return dts;
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index fd3bbec..33eaefd 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -586,7 +586,7 @@ static int flush_packet(AVFormatContext *ctx, int stream_index,
 
     id = stream->id;
 
-    av_dlog(ctx, "packet ID=%2x PTS=%0.3f\n", id, pts / 90000.0);
+    av_log(ctx, AV_LOG_TRACE, "packet ID=%2x PTS=%0.3f\n", id, pts / 90000.0);
 
     buf_ptr = buffer;
 
@@ -988,7 +988,7 @@ retry:
                 best_dts = pkt_desc->dts;
         }
 
-        av_dlog(ctx, "bumping scr, scr:%f, dts:%f\n",
+        av_log(ctx, AV_LOG_TRACE, "bumping scr, scr:%f, dts:%f\n",
                 scr / 90000.0, best_dts / 90000.0);
         if (best_dts == INT64_MAX)
             return 0;
@@ -1022,7 +1022,7 @@ retry:
     }
 
     if (timestamp_packet) {
-        av_dlog(ctx, "dts:%f pts:%f scr:%f stream:%d\n",
+        av_log(ctx, AV_LOG_TRACE, "dts:%f pts:%f scr:%f stream:%d\n",
                 timestamp_packet->dts / 90000.0,
                 timestamp_packet->pts / 90000.0,
                 scr / 90000.0, best_i);
@@ -1092,7 +1092,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
         dts += 2 * preload;
     }
 
-    av_dlog(ctx, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n",
+    av_log(ctx, AV_LOG_TRACE, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n",
             dts / 90000.0, pts / 90000.0, pkt->flags,
             pkt->stream_index, pts != AV_NOPTS_VALUE);
     if (!stream->premux_packet)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 39eb74a..ae9d1f4 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -353,7 +353,7 @@ static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts,
     MpegTSFilter *filter;
     MpegTSSectionFilter *sec;
 
-    av_dlog(ts->stream, "Filter: pid=0x%x\n", pid);
+    av_log(ts->stream, AV_LOG_TRACE, "Filter: pid=0x%x\n", pid);
 
     if (pid >= NB_PID_MAX || ts->pids[pid])
         return NULL;
@@ -465,7 +465,7 @@ static int get_packet_size(const uint8_t *buf, int size)
     score      = analyze(buf, size, TS_PACKET_SIZE,      NULL, 0);
     dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL, 0);
     fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE,  NULL, 0);
-    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
+    av_log(NULL, AV_LOG_TRACE, "score: %d, dvhs_score: %d, fec_score: %d \n",
             score, dvhs_score, fec_score);
 
     if (score > fec_score && score > dvhs_score)
@@ -834,7 +834,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
                     pes->header[2] == 0x01) {
                     /* it must be an mpeg2 PES stream */
                     code = pes->header[3] | 0x100;
-                    av_dlog(pes->stream, "pid=%x pes_code=%#x\n", pes->pid,
+                    av_log(pes->stream, AV_LOG_TRACE, "pid=%x pes_code=%#x\n", pes->pid,
                             code);
 
                     if ((pes->st && pes->st->discard == AVDISCARD_ALL &&
@@ -870,7 +870,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 == AV_CODEC_ID_NONE) {
-                            av_dlog(pes->stream,
+                            av_log(pes->stream, AV_LOG_TRACE,
                                     "pid=%x stream_type=%x probing\n",
                                     pes->pid,
                                     pes->stream_type);
@@ -1356,7 +1356,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
     if (desc_end > desc_list_end)
         return AVERROR_INVALIDDATA;
 
-    av_dlog(fc, "tag: 0x%02x len=%d\n", desc_tag, desc_len);
+    av_log(fc, AV_LOG_TRACE, "tag: 0x%02x len=%d\n", desc_tag, desc_len);
 
     if (st->codec->codec_id == AV_CODEC_ID_NONE &&
         stream_type == STREAM_TYPE_PRIVATE_DATA)
@@ -1462,7 +1462,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
         break;
     case 0x05: /* registration descriptor */
         st->codec->codec_tag = bytestream_get_le32(pp);
-        av_dlog(fc, "reg_desc=%.4s\n", (char *)&st->codec->codec_tag);
+        av_log(fc, AV_LOG_TRACE, "reg_desc=%.4s\n", (char *)&st->codec->codec_tag);
         if (st->codec->codec_id == AV_CODEC_ID_NONE)
             mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types);
         break;
@@ -1519,7 +1519,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = { { 0 } };
     int i;
 
-    av_dlog(ts->stream, "PMT: len %i\n", section_len);
+    av_log(ts->stream, AV_LOG_TRACE, "PMT: len %i\n", section_len);
     hex_dump_debug(ts->stream, section, section_len);
 
     p_end = section + section_len - 4;
@@ -1527,7 +1527,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     if (parse_section_header(h, &p, p_end) < 0)
         return;
 
-    av_dlog(ts->stream, "sid=0x%x sec_num=%d/%d\n",
+    av_log(ts->stream, AV_LOG_TRACE, "sid=0x%x sec_num=%d/%d\n",
             h->id, h->sec_num, h->last_sec_num);
 
     if (h->tid != PMT_TID)
@@ -1540,7 +1540,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     pcr_pid &= 0x1fff;
     add_pid_to_pmt(ts, h->id, pcr_pid);
 
-    av_dlog(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
+    av_log(ts->stream, AV_LOG_TRACE, "pcr_pid=0x%x\n", pcr_pid);
 
     program_info_length = get16(&p, p_end);
     if (program_info_length < 0)
@@ -1551,7 +1551,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
         tag = get8(&p, p_end);
         len = get8(&p, p_end);
 
-        av_dlog(ts->stream, "program tag: 0x%02x len=%d\n", tag, len);
+        av_log(ts->stream, AV_LOG_TRACE, "program tag: 0x%02x len=%d\n", tag, len);
 
         if (len > program_info_length - 2)
             // something else is broken, exit the program_descriptors_loop
@@ -1661,7 +1661,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     const uint8_t *p, *p_end;
     int sid, pmt_pid;
 
-    av_dlog(ts->stream, "PAT:\n");
+    av_log(ts->stream, AV_LOG_TRACE, "PAT:\n");
     hex_dump_debug(ts->stream, section, section_len);
 
     p_end = section + section_len - 4;
@@ -1681,7 +1681,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
             break;
         pmt_pid &= 0x1fff;
 
-        av_dlog(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
+        av_log(ts->stream, AV_LOG_TRACE, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
 
         if (sid == 0x0000) {
             /* NIT info */
@@ -1705,7 +1705,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
     int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type;
     char *name, *provider_name;
 
-    av_dlog(ts->stream, "SDT:\n");
+    av_log(ts->stream, AV_LOG_TRACE, "SDT:\n");
     hex_dump_debug(ts->stream, section, section_len);
 
     p_end = section + section_len - 4;
@@ -1743,7 +1743,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
             if (desc_end > desc_list_end)
                 break;
 
-            av_dlog(ts->stream, "tag: 0x%02x len=%d\n",
+            av_log(ts->stream, AV_LOG_TRACE, "tag: 0x%02x len=%d\n",
                     desc_tag, desc_len);
 
             switch (desc_tag) {
@@ -1941,7 +1941,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
 
     if (avio_tell(s->pb) != ts->last_pos) {
         int i;
-        av_dlog(ts->stream, "Skipping after seek\n");
+        av_log(ts->stream, AV_LOG_TRACE, "Skipping after seek\n");
         /* seek detected, flush pes buffer */
         for (i = 0; i < NB_PID_MAX; i++) {
             if (ts->pids[i]) {
@@ -1993,7 +1993,7 @@ static int mpegts_probe(AVProbeData *p)
                          TS_DVHS_PACKET_SIZE, NULL, 1) * CHECK_COUNT / check_count;
     fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE * check_count,
                         TS_FEC_PACKET_SIZE, NULL, 1) * CHECK_COUNT / check_count;
-    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
+    av_log(NULL, AV_LOG_TRACE, "score: %d, dvhs_score: %d, fec_score: %d \n",
             score, dvhs_score, fec_score);
 
     /* we need a clear definition for the returned score otherwise
@@ -2073,7 +2073,7 @@ static int mpegts_read_header(AVFormatContext *s)
 
         ts->auto_guess = 1;
 
-        av_dlog(ts->stream, "tuning done\n");
+        av_log(ts->stream, AV_LOG_TRACE, "tuning done\n");
 
         s->ctx_flags |= AVFMTCTX_NOHEADER;
     } else {
@@ -2124,7 +2124,7 @@ static int mpegts_read_header(AVFormatContext *s)
         s->bit_rate  = TS_PACKET_SIZE * 8 * 27e6 / ts->pcr_incr;
         st->codec->bit_rate = s->bit_rate;
         st->start_time      = ts->cur_pcr;
-        av_dlog(ts->stream, "start=%0.3f pcr=%0.3f incr=%d\n",
+        av_log(ts->stream, AV_LOG_TRACE, "start=%0.3f pcr=%0.3f incr=%d\n",
                 st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
     }
 
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 28b700e..75c93a7 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1071,7 +1071,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
 
         do {
             p = avpriv_find_start_code(p, buf_end, &state);
-            av_dlog(s, "nal %d\n", state & 0x1f);
+            av_log(s, AV_LOG_TRACE, "nal %d\n", state & 0x1f);
         } while (p < buf_end && (state & 0x1f) != 9 &&
                  (state & 0x1f) != 5 && (state & 0x1f) != 1);
 
diff --git a/libavformat/mux.c b/libavformat/mux.c
index c09456b..503241f 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -264,7 +264,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
     int delay = FFMAX(st->codec->has_b_frames, !!st->codec->max_b_frames);
     int num, den, i;
 
-    av_dlog(s, "compute_pkt_fields2: pts:%" PRId64 " dts:%" PRId64 " cur_dts:%" PRId64 " b:%d size:%d st:%d\n",
+    av_log(s, AV_LOG_TRACE, "compute_pkt_fields2: pts:%" PRId64 " dts:%" PRId64 " cur_dts:%" PRId64 " b:%d size:%d st:%d\n",
             pkt->pts, pkt->dts, st->cur_dts, delay, pkt->size, pkt->stream_index);
 
 /*    if(pkt->pts == AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE)
@@ -308,7 +308,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
         return AVERROR(EINVAL);
     }
 
-    av_dlog(s, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n",
+    av_log(s, AV_LOG_TRACE, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n",
             pkt->pts, pkt->dts);
     st->cur_dts = pkt->dts;
 
@@ -560,7 +560,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
     if (pkt) {
         AVStream *st = s->streams[pkt->stream_index];
 
-        av_dlog(s, "av_interleaved_write_frame size:%d dts:%" PRId64 " pts:%" PRId64 "\n",
+        av_log(s, AV_LOG_TRACE, "av_interleaved_write_frame size:%d dts:%" PRId64 " pts:%" PRId64 "\n",
                 pkt->size, pkt->dts, pkt->pts);
         if ((ret = compute_pkt_fields2(s, st, pkt)) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
             goto fail;
@@ -570,7 +570,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
             goto fail;
         }
     } else {
-        av_dlog(s, "av_interleaved_write_frame FLUSH\n");
+        av_log(s, AV_LOG_TRACE, "av_interleaved_write_frame FLUSH\n");
         flush = 1;
     }
 
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 563f0ed..25545dc 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -510,7 +510,7 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
         }
     }
 
-    av_dlog(mxf->fc,
+    av_log(mxf->fc, AV_LOG_TRACE,
             "PartitionPack: ThisPartition = 0x%"PRIX64
             ", PreviousPartition = 0x%"PRIX64", "
             "FooterPartition = 0x%"PRIX64", IndexSID = %i, BodySID = %i\n",
@@ -775,32 +775,32 @@ static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int
     switch(tag) {
     case 0x3F05:
         segment->edit_unit_byte_count = avio_rb32(pb);
-        av_dlog(NULL, "EditUnitByteCount %d\n", segment->edit_unit_byte_count);
+        av_log(NULL, AV_LOG_TRACE, "EditUnitByteCount %d\n", segment->edit_unit_byte_count);
         break;
     case 0x3F06:
         segment->index_sid = avio_rb32(pb);
-        av_dlog(NULL, "IndexSID %d\n", segment->index_sid);
+        av_log(NULL, AV_LOG_TRACE, "IndexSID %d\n", segment->index_sid);
         break;
     case 0x3F07:
         segment->body_sid = avio_rb32(pb);
-        av_dlog(NULL, "BodySID %d\n", segment->body_sid);
+        av_log(NULL, AV_LOG_TRACE, "BodySID %d\n", segment->body_sid);
         break;
     case 0x3F0A:
-        av_dlog(NULL, "IndexEntryArray found\n");
+        av_log(NULL, AV_LOG_TRACE, "IndexEntryArray found\n");
         return mxf_read_index_entry_array(pb, segment);
     case 0x3F0B:
         segment->index_edit_rate.num = avio_rb32(pb);
         segment->index_edit_rate.den = avio_rb32(pb);
-        av_dlog(NULL, "IndexEditRate %d/%d\n", segment->index_edit_rate.num,
+        av_log(NULL, AV_LOG_TRACE, "IndexEditRate %d/%d\n", segment->index_edit_rate.num,
                 segment->index_edit_rate.den);
         break;
     case 0x3F0C:
         segment->index_start_position = avio_rb64(pb);
-        av_dlog(NULL, "IndexStartPosition %"PRId64"\n", segment->index_start_position);
+        av_log(NULL, AV_LOG_TRACE, "IndexStartPosition %"PRId64"\n", segment->index_start_position);
         break;
     case 0x3F0D:
         segment->index_duration = avio_rb64(pb);
-        av_dlog(NULL, "IndexDuration %"PRId64"\n", segment->index_duration);
+        av_log(NULL, AV_LOG_TRACE, "IndexDuration %"PRId64"\n", segment->index_duration);
         break;
     }
     return 0;
@@ -814,7 +814,7 @@ static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor)
     do {
         code = avio_r8(pb);
         value = avio_r8(pb);
-        av_dlog(NULL, "pixel layout: code %#x\n", code);
+        av_log(NULL, AV_LOG_TRACE, "pixel layout: code %#x\n", code);
 
         if (ofs <= 14) {
             layout[ofs++] = code;
@@ -1369,7 +1369,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
     MXFPackage *temp_package = NULL;
     int i, j, k, ret;
 
-    av_dlog(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count);
+    av_log(mxf->fc, AV_LOG_TRACE, "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);
@@ -1420,7 +1420,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
                 }
             }
             if (!source_package) {
-                av_dlog(mxf->fc, "material track %d: no corresponding source package found\n", material_track->track_id);
+                av_log(mxf->fc, AV_LOG_TRACE, "material track %d: no corresponding source package found\n", material_track->track_id);
                 break;
             }
             for (k = 0; k < source_package->tracks_count; k++) {
@@ -1849,7 +1849,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
         uint64_t next = avio_tell(pb) + size;
         UID uid = {0};
 
-        av_dlog(mxf->fc, "local tag %#04x size %d\n", tag, size);
+        av_log(mxf->fc, AV_LOG_TRACE, "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;
@@ -1860,7 +1860,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);
-                    av_dlog(mxf->fc, "local tag %#04x\n", local_tag);
+                    av_log(mxf->fc, AV_LOG_TRACE, "local tag %#04x\n", local_tag);
                     PRINT_KEY(mxf->fc, "uid", uid);
                 }
             }
@@ -1903,7 +1903,7 @@ static int mxf_seek_to_previous_partition(MXFContext *mxf)
     avio_seek(pb, mxf->run_in + mxf->current_partition->previous_partition, SEEK_SET);
     mxf->current_partition = NULL;
 
-    av_dlog(mxf->fc, "seeking to previous partition\n");
+    av_log(mxf->fc, AV_LOG_TRACE, "seeking to previous partition\n");
 
     return 1;
 }
@@ -1924,11 +1924,11 @@ static int mxf_parse_handle_essence(MXFContext *mxf)
                                                 : mxf->last_partition;
 
         if (!offset) {
-            av_dlog(mxf->fc, "no last partition\n");
+            av_log(mxf->fc, AV_LOG_TRACE, "no last partition\n");
             return 0;
         }
 
-        av_dlog(mxf->fc, "seeking to last partition\n");
+        av_log(mxf->fc, AV_LOG_TRACE, "seeking to last partition\n");
 
         /* remember where we were so we don't end up seeking further back than this */
         mxf->last_forward_tell = avio_tell(pb);
@@ -2134,7 +2134,7 @@ static int mxf_read_header(AVFormatContext *s)
         }
 
         PRINT_KEY(s, "read header", klv.key);
-        av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
+        av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
         if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
             IS_KLV_KEY(klv.key, mxf_essence_element_key) ||
             IS_KLV_KEY(klv.key, mxf_avid_essence_element_key) ||
@@ -2343,7 +2343,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
         if ((ret = klv_read_packet(&klv, s->pb)) < 0)
             return ret;
         PRINT_KEY(s, "read packet", klv.key);
-        av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
+        av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
         if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) {
             ret = mxf_decrypt_triplet(s, pkt, &klv);
             if (ret < 0) {
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 69c0dd8..f434b4a 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1870,7 +1870,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
         }
 
         *out = pktl->pkt;
-        av_dlog(s, "out st:%d dts:%"PRId64"\n", (*out).stream_index, (*out).dts);
+        av_log(s, AV_LOG_TRACE, "out st:%d dts:%"PRId64"\n", (*out).stream_index, (*out).dts);
         s->internal->packet_buffer = pktl->next;
         if(s->streams[pktl->pkt.stream_index]->last_in_packet_buffer == pktl)
             s->streams[pktl->pkt.stream_index]->last_in_packet_buffer= NULL;
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index c8ac74c..7c8f9e3 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -214,7 +214,7 @@ static const AVCodecTag nsv_codec_audio_tags[] = {
 static int nsv_read_chunk(AVFormatContext *s, int fill_header);
 
 #define print_tag(str, tag, size)       \
-    av_dlog(NULL, "%s: tag=%c%c%c%c\n", \
+    av_log(NULL, AV_LOG_TRACE, "%s: tag=%c%c%c%c\n", \
             str, tag & 0xff,            \
             (tag >> 8) & 0xff,          \
             (tag >> 16) & 0xff,         \
@@ -228,41 +228,41 @@ static int nsv_resync(AVFormatContext *s)
     uint32_t v = 0;
     int i;
 
-    av_dlog(s, "%s(), offset = %"PRId64", state = %d\n", __FUNCTION__, avio_tell(pb), nsv->state);
+    av_log(s, AV_LOG_TRACE, "%s(), offset = %"PRId64", state = %d\n", __FUNCTION__, avio_tell(pb), nsv->state);
 
     //nsv->state = NSV_UNSYNC;
 
     for (i = 0; i < NSV_MAX_RESYNC; i++) {
         if (pb->eof_reached) {
-            av_dlog(s, "NSV EOF\n");
+            av_log(s, AV_LOG_TRACE, "NSV EOF\n");
             nsv->state = NSV_UNSYNC;
             return -1;
         }
         v <<= 8;
         v |= avio_r8(pb);
         if (i < 8) {
-            av_dlog(s, "NSV resync: [%d] = %02x\n", i, v & 0x0FF);
+            av_log(s, AV_LOG_TRACE, "NSV resync: [%d] = %02x\n", i, v & 0x0FF);
         }
 
         if ((v & 0x0000ffff) == 0xefbe) { /* BEEF */
-            av_dlog(s, "NSV resynced on BEEF after %d bytes\n", i+1);
+            av_log(s, AV_LOG_TRACE, "NSV resynced on BEEF after %d bytes\n", i+1);
             nsv->state = NSV_FOUND_BEEF;
             return 0;
         }
         /* we read as big-endian, thus the MK*BE* */
         if (v == TB_NSVF) { /* NSVf */
-            av_dlog(s, "NSV resynced on NSVf after %d bytes\n", i+1);
+            av_log(s, AV_LOG_TRACE, "NSV resynced on NSVf after %d bytes\n", i+1);
             nsv->state = NSV_FOUND_NSVF;
             return 0;
         }
         if (v == MKBETAG('N', 'S', 'V', 's')) { /* NSVs */
-            av_dlog(s, "NSV resynced on NSVs after %d bytes\n", i+1);
+            av_log(s, AV_LOG_TRACE, "NSV resynced on NSVs after %d bytes\n", i+1);
             nsv->state = NSV_FOUND_NSVS;
             return 0;
         }
 
     }
-    av_dlog(s, "NSV sync lost\n");
+    av_log(s, AV_LOG_TRACE, "NSV sync lost\n");
     return -1;
 }
 
@@ -277,7 +277,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
     int table_entries;
     int table_entries_used;
 
-    av_dlog(s, "%s()\n", __FUNCTION__);
+    av_log(s, AV_LOG_TRACE, "%s()\n", __FUNCTION__);
 
     nsv->state = NSV_UNSYNC; /* in case we fail */
 
@@ -288,22 +288,22 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
 
     //s->file_size = (uint32_t)avio_rl32(pb);
     file_size = (uint32_t)avio_rl32(pb);
-    av_dlog(s, "NSV NSVf chunk_size %u\n", size);
-    av_dlog(s, "NSV NSVf file_size %u\n", file_size);
+    av_log(s, AV_LOG_TRACE, "NSV NSVf chunk_size %u\n", size);
+    av_log(s, AV_LOG_TRACE, "NSV NSVf file_size %u\n", file_size);
 
     nsv->duration = duration = avio_rl32(pb); /* in ms */
-    av_dlog(s, "NSV NSVf duration %"PRId64" ms\n", duration);
+    av_log(s, AV_LOG_TRACE, "NSV NSVf duration %"PRId64" ms\n", duration);
     // XXX: store it in AVStreams
 
     strings_size = avio_rl32(pb);
     table_entries = avio_rl32(pb);
     table_entries_used = avio_rl32(pb);
-    av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
+    av_log(s, AV_LOG_TRACE, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
             strings_size, table_entries, table_entries_used);
     if (pb->eof_reached)
         return -1;
 
-    av_dlog(s, "NSV got header; filepos %"PRId64"\n", avio_tell(pb));
+    av_log(s, AV_LOG_TRACE, "NSV got header; filepos %"PRId64"\n", avio_tell(pb));
 
     if (strings_size > 0) {
         char *strings; /* last byte will be '\0' to play safe with str*() */
@@ -332,7 +332,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
             if (!p || p >= endp)
                 break;
             *p++ = '\0';
-            av_dlog(s, "NSV NSVf INFO: %s='%s'\n", token, value);
+            av_log(s, AV_LOG_TRACE, "NSV NSVf INFO: %s='%s'\n", token, value);
             av_dict_set(&s->metadata, token, value, 0);
         }
         av_free(strings);
@@ -340,7 +340,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
     if (pb->eof_reached)
         return -1;
 
-    av_dlog(s, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb));
+    av_log(s, AV_LOG_TRACE, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb));
 
     if (table_entries_used > 0) {
         int i;
@@ -365,7 +365,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
         }
     }
 
-    av_dlog(s, "NSV got index; filepos %"PRId64"\n", avio_tell(pb));
+    av_log(s, AV_LOG_TRACE, "NSV got index; filepos %"PRId64"\n", avio_tell(pb));
 
     avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
 
@@ -385,7 +385,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
     int i;
     AVStream *st;
     NSVStream *nst;
-    av_dlog(s, "%s()\n", __FUNCTION__);
+    av_log(s, AV_LOG_TRACE, "%s()\n", __FUNCTION__);
 
     vtag = avio_rl32(pb);
     atag = avio_rl32(pb);
@@ -393,7 +393,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
     vheight = avio_rl16(pb);
     i = avio_r8(pb);
 
-    av_dlog(s, "NSV NSVs framerate code %2x\n", i);
+    av_log(s, AV_LOG_TRACE, "NSV NSVs framerate code %2x\n", i);
     if(i&0x80) { /* odd way of giving native framerates from docs */
         int t=(i & 0x7F)>>2;
         if(t<16) framerate = (AVRational){1, t+1};
@@ -416,7 +416,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
 
     print_tag("NSV NSVs vtag", vtag, 0);
     print_tag("NSV NSVs atag", atag, 0);
-    av_dlog(s, "NSV NSVs vsize %dx%d\n", vwidth, vheight);
+    av_log(s, AV_LOG_TRACE, "NSV NSVs vsize %dx%d\n", vwidth, vheight);
 
     /* XXX change to ap != NULL ? */
     if (s->nb_streams == 0) { /* streams not yet published, let's do that */
@@ -479,7 +479,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
         }
     } else {
         if (nsv->vtag != vtag || nsv->atag != atag || nsv->vwidth != vwidth || nsv->vheight != vwidth) {
-            av_dlog(s, "NSV NSVs header values differ from the first one!!!\n");
+            av_log(s, AV_LOG_TRACE, "NSV NSVs header values differ from the first one!!!\n");
             //return -1;
         }
     }
@@ -497,8 +497,8 @@ static int nsv_read_header(AVFormatContext *s)
     NSVContext *nsv = s->priv_data;
     int i, err;
 
-    av_dlog(s, "%s()\n", __FUNCTION__);
-    av_dlog(s, "filename '%s'\n", s->filename);
+    av_log(s, AV_LOG_TRACE, "%s()\n", __FUNCTION__);
+    av_log(s, AV_LOG_TRACE, "filename '%s'\n", s->filename);
 
     nsv->state = NSV_UNSYNC;
     nsv->ahead[0].data = nsv->ahead[1].data = NULL;
@@ -524,7 +524,7 @@ static int nsv_read_header(AVFormatContext *s)
     /* now read the first chunk, so we can attempt to decode more info */
     err = nsv_read_chunk(s, 1);
 
-    av_dlog(s, "parsed header\n");
+    av_log(s, AV_LOG_TRACE, "parsed header\n");
     return err;
 }
 
@@ -541,7 +541,7 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header)
     uint16_t asize;
     uint16_t auxsize;
 
-    av_dlog(s, "%s(%d)\n", __FUNCTION__, fill_header);
+    av_log(s, AV_LOG_TRACE, "%s(%d)\n", __FUNCTION__, fill_header);
 
     if (nsv->ahead[0].data || nsv->ahead[1].data)
         return 0; //-1; /* hey! eat what you've in your plate first! */
@@ -566,13 +566,13 @@ null_chunk_retry:
     asize = avio_rl16(pb);
     vsize = (vsize << 4) | (auxcount >> 4);
     auxcount &= 0x0f;
-    av_dlog(s, "NSV CHUNK %d aux, %u bytes video, %d bytes audio\n", auxcount, vsize, asize);
+    av_log(s, AV_LOG_TRACE, "NSV CHUNK %d aux, %u bytes video, %d bytes audio\n", auxcount, vsize, asize);
     /* skip aux stuff */
     for (i = 0; i < auxcount; i++) {
         uint32_t av_unused auxtag;
         auxsize = avio_rl16(pb);
         auxtag = avio_rl32(pb);
-        av_dlog(s, "NSV aux data: '%c%c%c%c', %d bytes\n",
+        av_log(s, AV_LOG_TRACE, "NSV aux data: '%c%c%c%c', %d bytes\n",
               (auxtag & 0x0ff),
               ((auxtag >> 8) & 0x0ff),
               ((auxtag >> 16) & 0x0ff),
@@ -603,7 +603,7 @@ null_chunk_retry:
         pkt->dts = nst->frame_offset;
         pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */
         for (i = 0; i < FFMIN(8, vsize); i++)
-            av_dlog(s, "NSV video: [%d] = %02x\n", i, pkt->data[i]);
+            av_log(s, AV_LOG_TRACE, "NSV video: [%d] = %02x\n", i, pkt->data[i]);
     }
     if(st[NSV_ST_VIDEO])
         ((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset++;
@@ -623,11 +623,11 @@ null_chunk_retry:
             if (!channels || !samplerate)
                 return AVERROR_INVALIDDATA;
             asize-=4;
-            av_dlog(s, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
+            av_log(s, AV_LOG_TRACE, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
             if (fill_header) {
                 st[NSV_ST_AUDIO]->need_parsing = AVSTREAM_PARSE_NONE; /* we know everything */
                 if (bps != 16) {
-                    av_dlog(s, "NSV AUDIO bit/sample != 16 (%d)!!!\n", bps);
+                    av_log(s, AV_LOG_TRACE, "NSV AUDIO bit/sample != 16 (%d)!!!\n", bps);
                 }
                 bps /= channels; // ???
                 if (bps == 8)
@@ -636,7 +636,7 @@ null_chunk_retry:
                 channels = 1;
                 st[NSV_ST_AUDIO]->codec->channels = channels;
                 st[NSV_ST_AUDIO]->codec->sample_rate = samplerate;
-                av_dlog(s, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
+                av_log(s, AV_LOG_TRACE, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
             }
         }
         av_get_packet(pb, pkt, asize);
@@ -647,7 +647,7 @@ null_chunk_retry:
             pkt->dts = (((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset-1);
             pkt->dts *= (int64_t)1000        * nsv->framerate.den;
             pkt->dts += (int64_t)nsv->avsync * nsv->framerate.num;
-            av_dlog(s, "NSV AUDIO: sync:%d, dts:%"PRId64, nsv->avsync, pkt->dts);
+            av_log(s, AV_LOG_TRACE, "NSV AUDIO: sync:%d, dts:%"PRId64, nsv->avsync, pkt->dts);
         }
         nst->frame_offset++;
     }
@@ -662,7 +662,7 @@ static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
     NSVContext *nsv = s->priv_data;
     int i, err = 0;
 
-    av_dlog(s, "%s()\n", __FUNCTION__);
+    av_log(s, AV_LOG_TRACE, "%s()\n", __FUNCTION__);
 
     /* in case we don't already have something to eat ... */
     if (!nsv->ahead[0].data && !nsv->ahead[1].data)
@@ -673,7 +673,7 @@ static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
     /* now pick one of the plates */
     for (i = 0; i < 2; i++) {
         if (nsv->ahead[i].data) {
-            av_dlog(s, "%s: using cached packet[%d]\n", __FUNCTION__, i);
+            av_log(s, AV_LOG_TRACE, "%s: using cached packet[%d]\n", __FUNCTION__, i);
             /* avoid the cost of new_packet + memcpy(->data) */
             memcpy(pkt, &nsv->ahead[i], sizeof(AVPacket));
             nsv->ahead[i].data = NULL; /* we ate that one */
@@ -723,7 +723,7 @@ static int nsv_probe(AVProbeData *p)
     int score;
     int vsize, asize, auxcount;
     score = 0;
-    av_dlog(NULL, "nsv_probe(), buf_size %d\n", p->buf_size);
+    av_log(NULL, AV_LOG_TRACE, "nsv_probe(), buf_size %d\n", p->buf_size);
     /* check file header */
     /* streamed files might not have any header */
     if (p->buf[0] == 'N' && p->buf[1] == 'S' &&
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 86ea70f..1dc9026 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -344,7 +344,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
     int complete = 0;
     int segp     = 0, psize = 0;
 
-    av_dlog(s, "ogg_packet: curidx=%i\n", ogg->curidx);
+    av_log(s, AV_LOG_TRACE, "ogg_packet: curidx=%i\n", ogg->curidx);
 
     do {
         idx = ogg->curidx;
@@ -357,7 +357,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
 
         os = ogg->streams + idx;
 
-        av_dlog(s, "ogg_packet: idx=%d pstart=%d psize=%d segp=%d nsegs=%d\n",
+        av_log(s, AV_LOG_TRACE, "ogg_packet: idx=%d pstart=%d psize=%d segp=%d nsegs=%d\n",
                 idx, os->pstart, os->psize, os->segp, os->nsegs);
 
         if (!os->codec) {
@@ -395,7 +395,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
         }
     } while (!complete);
 
-    av_dlog(s, "ogg_packet: idx %i, frame size %i, start %i\n",
+    av_log(s, AV_LOG_TRACE, "ogg_packet: idx %i, frame size %i, start %i\n",
             idx, os->psize, os->pstart);
 
     if (os->granule == -1)
@@ -495,7 +495,7 @@ static int ogg_get_headers(AVFormatContext *s)
             os->lastpts = s->streams[i]->start_time =
                 ogg_gptopts(s, i, os->start_granule, NULL);
     }
-    av_dlog(s, "found headers\n");
+    av_log(s, AV_LOG_TRACE, "found headers\n");
 
     return 0;
 }
diff --git a/libavformat/r3d.c b/libavformat/r3d.c
index bcea462..a99f265 100644
--- a/libavformat/r3d.c
+++ b/libavformat/r3d.c
@@ -44,7 +44,7 @@ static int read_atom(AVFormatContext *s, Atom *atom)
     if (atom->size < 8)
         return -1;
     atom->tag = avio_rl32(s->pb);
-    av_dlog(s, "atom %u %.4s offset %#"PRIx64"\n",
+    av_log(s, AV_LOG_TRACE, "atom %u %.4s offset %#"PRIx64"\n",
             atom->size, (char*)&atom->tag, atom->offset);
     return atom->size;
 }
@@ -64,16 +64,16 @@ static int r3d_read_red1(AVFormatContext *s)
 
     tmp  = avio_r8(s->pb); // major version
     tmp2 = avio_r8(s->pb); // minor version
-    av_dlog(s, "version %d.%d\n", tmp, tmp2);
+    av_log(s, AV_LOG_TRACE, "version %d.%d\n", tmp, tmp2);
 
     tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown1 %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "unknown1 %d\n", tmp);
 
     tmp = avio_rb32(s->pb);
     avpriv_set_pts_info(st, 32, 1, tmp);
 
     tmp = avio_rb32(s->pb); // filenum
-    av_dlog(s, "filenum %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "filenum %d\n", tmp);
 
     avio_skip(s->pb, 32); // unknown
 
@@ -81,7 +81,7 @@ static int r3d_read_red1(AVFormatContext *s)
     st->codec->height = avio_rb32(s->pb);
 
     tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown2 %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "unknown2 %d\n", tmp);
 
     framerate.num = avio_rb16(s->pb);
     framerate.den = avio_rb16(s->pb);
@@ -90,7 +90,7 @@ static int r3d_read_red1(AVFormatContext *s)
     }
 
     tmp = avio_r8(s->pb); // audio channels
-    av_dlog(s, "audio channels %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "audio channels %d\n", tmp);
     if (tmp > 0) {
         AVStream *ast = avformat_new_stream(s, NULL);
         if (!ast)
@@ -105,10 +105,10 @@ static int r3d_read_red1(AVFormatContext *s)
     filename[sizeof(filename)-1] = 0;
     av_dict_set(&st->metadata, "filename", filename, 0);
 
-    av_dlog(s, "filename %s\n", filename);
-    av_dlog(s, "resolution %dx%d\n", st->codec->width, st->codec->height);
-    av_dlog(s, "timescale %d\n", st->time_base.den);
-    av_dlog(s, "frame rate %d/%d\n",
+    av_log(s, AV_LOG_TRACE, "filename %s\n", filename);
+    av_log(s, AV_LOG_TRACE, "resolution %dx%d\n", st->codec->width, st->codec->height);
+    av_log(s, AV_LOG_TRACE, "timescale %d\n", st->time_base.den);
+    av_log(s, AV_LOG_TRACE, "frame rate %d/%d\n",
             framerate.num, framerate.den);
 
     return 0;
@@ -131,7 +131,7 @@ static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)
             r3d->video_offsets_count = i;
             break;
         }
-        av_dlog(s, "video offset %d: %#x\n", i, r3d->video_offsets[i]);
+        av_log(s, AV_LOG_TRACE, "video offset %d: %#x\n", i, r3d->video_offsets[i]);
     }
 
     if (st->avg_frame_rate.num)
@@ -139,7 +139,7 @@ static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)
                                     (AVRational){st->avg_frame_rate.den,
                                                  st->avg_frame_rate.num},
                                     st->time_base);
-    av_dlog(s, "duration %"PRId64"\n", st->duration);
+    av_log(s, AV_LOG_TRACE, "duration %"PRId64"\n", st->duration);
 
     return 0;
 }
@@ -155,10 +155,10 @@ static void r3d_read_reos(AVFormatContext *s)
     avio_rb32(s->pb); // rdas offset
 
     tmp = avio_rb32(s->pb);
-    av_dlog(s, "num video chunks %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "num video chunks %d\n", tmp);
 
     tmp = avio_rb32(s->pb);
-    av_dlog(s, "num audio chunks %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "num audio chunks %d\n", tmp);
 
     avio_skip(s->pb, 6*4);
 }
@@ -184,7 +184,7 @@ static int r3d_read_header(AVFormatContext *s)
     }
 
     s->internal->data_offset = avio_tell(s->pb);
-    av_dlog(s, "data offset %#"PRIx64"\n", s->internal->data_offset);
+    av_log(s, AV_LOG_TRACE, "data offset %#"PRIx64"\n", s->internal->data_offset);
     if (!s->pb->seekable)
         return 0;
     // find REOB/REOF/REOS to load index
@@ -226,29 +226,29 @@ static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
     dts = avio_rb32(s->pb);
 
     tmp = avio_rb32(s->pb);
-    av_dlog(s, "frame num %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "frame num %d\n", tmp);
 
     tmp  = avio_r8(s->pb); // major version
     tmp2 = avio_r8(s->pb); // minor version
-    av_dlog(s, "version %d.%d\n", tmp, tmp2);
+    av_log(s, AV_LOG_TRACE, "version %d.%d\n", tmp, tmp2);
 
     tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "unknown %d\n", tmp);
 
     if (tmp > 4) {
         tmp = avio_rb16(s->pb); // unknown
-        av_dlog(s, "unknown %d\n", tmp);
+        av_log(s, AV_LOG_TRACE, "unknown %d\n", tmp);
 
         tmp = avio_rb16(s->pb); // unknown
-        av_dlog(s, "unknown %d\n", tmp);
+        av_log(s, AV_LOG_TRACE, "unknown %d\n", tmp);
 
         tmp = avio_rb32(s->pb);
-        av_dlog(s, "width %d\n", tmp);
+        av_log(s, AV_LOG_TRACE, "width %d\n", tmp);
         tmp = avio_rb32(s->pb);
-        av_dlog(s, "height %d\n", tmp);
+        av_log(s, AV_LOG_TRACE, "height %d\n", tmp);
 
         tmp = avio_rb32(s->pb);
-        av_dlog(s, "metadata len %d\n", tmp);
+        av_log(s, AV_LOG_TRACE, "metadata len %d\n", tmp);
     }
     tmp = atom->size - 8 - (avio_tell(s->pb) - pos);
     if (tmp < 0)
@@ -264,7 +264,7 @@ static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
     if (st->avg_frame_rate.num)
         pkt->duration = (uint64_t)st->time_base.den*
             st->avg_frame_rate.den/st->avg_frame_rate.num;
-    av_dlog(s, "pkt dts %"PRId64" duration %d\n", pkt->dts, pkt->duration);
+    av_log(s, AV_LOG_TRACE, "pkt dts %"PRId64" duration %d\n", pkt->dts, pkt->duration);
 
     return 0;
 }
@@ -289,17 +289,17 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
     samples = avio_rb32(s->pb);
 
     tmp = avio_rb32(s->pb);
-    av_dlog(s, "packet num %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "packet num %d\n", tmp);
 
     tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "unknown %d\n", tmp);
 
     tmp  = avio_r8(s->pb); // major version
     tmp2 = avio_r8(s->pb); // minor version
-    av_dlog(s, "version %d.%d\n", tmp, tmp2);
+    av_log(s, AV_LOG_TRACE, "version %d.%d\n", tmp, tmp2);
 
     tmp = avio_rb32(s->pb); // unknown
-    av_dlog(s, "unknown %d\n", tmp);
+    av_log(s, AV_LOG_TRACE, "unknown %d\n", tmp);
 
     size = atom->size - 8 - (avio_tell(s->pb) - pos);
     if (size < 0)
@@ -313,7 +313,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);
-    av_dlog(s, "pkt dts %"PRId64" duration %d samples %d sample rate %d\n",
+    av_log(s, AV_LOG_TRACE, "pkt dts %"PRId64" duration %d samples %d sample rate %d\n",
             pkt->dts, pkt->duration, samples, st->codec->sample_rate);
 
     return 0;
@@ -370,7 +370,7 @@ static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, i
 
     frame_num = av_rescale_q(sample_time, st->time_base,
                              (AVRational){st->avg_frame_rate.den, st->avg_frame_rate.num});
-    av_dlog(s, "seek frame num %d timestamp %"PRId64"\n",
+    av_log(s, AV_LOG_TRACE, "seek frame num %d timestamp %"PRId64"\n",
             frame_num, sample_time);
 
     if (frame_num < r3d->video_offsets_count) {
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index e2cf61f..cab75fd 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -319,7 +319,7 @@ int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb,
         st->codec->codec_tag = avio_rl32(pb);
         st->codec->codec_id  = ff_codec_get_id(ff_rm_codec_tags,
                                                st->codec->codec_tag);
-        av_dlog(s, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
+        av_log(s, AV_LOG_TRACE, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
         if (st->codec->codec_id == AV_CODEC_ID_NONE)
             goto fail1;
         st->codec->width  = avio_rb16(pb);
@@ -452,7 +452,7 @@ static int rm_read_header(AVFormatContext *s)
         tag = avio_rl32(pb);
         tag_size = avio_rb32(pb);
         avio_rb16(pb);
-        av_dlog(s, "tag=%c%c%c%c (%08x) size=%d\n",
+        av_log(s, AV_LOG_TRACE, "tag=%c%c%c%c (%08x) size=%d\n",
                 (tag      ) & 0xff,
                 (tag >>  8) & 0xff,
                 (tag >> 16) & 0xff,
@@ -946,7 +946,7 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
         }
 
         if((flags&2) && (seq&0x7F) == 1){
-            av_dlog(s, "%d %d-%d %"PRId64" %d\n",
+            av_log(s, AV_LOG_TRACE, "%d %d-%d %"PRId64" %d\n",
                     flags, stream_index2, stream_index, dts, seq);
             av_add_index_entry(st, pos, dts, 0, 0, AVINDEX_KEYFRAME);
             if(stream_index2 == stream_index)
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index be87b4d..e75a519 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2310,7 +2310,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
 
     switch (pkt->type) {
     case RTMP_PT_BYTES_READ:
-        av_dlog(s, "received bytes read report\n");
+        av_log(s, AV_LOG_TRACE, "received bytes read report\n");
         break;
     case RTMP_PT_CHUNK_SIZE:
         if ((ret = handle_chunk_size(s, pkt)) < 0)
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index dd2e58f..0efcdb9 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -355,9 +355,9 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd,
     len = avio_close_dyn_buf(pb, &buf);
     if ((len > 0) && buf) {
         int av_unused result;
-        av_dlog(s->ic, "sending %d bytes of RR\n", len);
+        av_log(s->ic, AV_LOG_TRACE, "sending %d bytes of RR\n", len);
         result = ffurl_write(fd, buf, len);
-        av_dlog(s->ic, "result from ffurl_write: %d\n", result);
+        av_log(s->ic, AV_LOG_TRACE, "result from ffurl_write: %d\n", result);
         av_free(buf);
     }
     return 0;
diff --git a/libavformat/rtpdec_hevc.c b/libavformat/rtpdec_hevc.c
index ef47388..a4d9c54 100644
--- a/libavformat/rtpdec_hevc.c
+++ b/libavformat/rtpdec_hevc.c
@@ -52,7 +52,7 @@ static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s,
     /* profile-id: 0-31 */
     if (!strcmp(attr, "profile-id")) {
         hevc_data->profile_id = atoi(value);
-        av_dlog(s, "SDP: found profile-id: %d\n", hevc_data->profile_id);
+        av_log(s, AV_LOG_TRACE, "SDP: found profile-id: %d\n", hevc_data->profile_id);
     }
 
     /* tier-flag: 0-1 */
@@ -102,7 +102,7 @@ static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s,
     if (!strcmp(attr, "sprop-max-don-diff")) {
         if (atoi(value) > 0)
             hevc_data->using_donl_field = 1;
-        av_dlog(s, "Found sprop-max-don-diff in SDP, DON field usage is: %d\n",
+        av_log(s, AV_LOG_TRACE, "Found sprop-max-don-diff in SDP, DON field usage is: %d\n",
                 hevc_data->using_donl_field);
     }
 
@@ -110,7 +110,7 @@ static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s,
     if (!strcmp(attr, "sprop-depack-buf-nalus")) {
         if (atoi(value) > 0)
             hevc_data->using_donl_field = 1;
-        av_dlog(s, "Found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n",
+        av_log(s, AV_LOG_TRACE, "Found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n",
                 hevc_data->using_donl_field);
     }
 
@@ -305,7 +305,7 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
             len -= RTP_HEVC_DONL_FIELD_SIZE;
         }
 
-        av_dlog(ctx, " FU type %d with %d bytes\n", fu_type, len);
+        av_log(ctx, AV_LOG_TRACE, " FU type %d with %d bytes\n", fu_type, len);
 
         if (len <= 0) {
             /* sanity check for size of input packet: 1 byte payload at least */
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index d94f254..6158934 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -259,7 +259,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye)
     RTPMuxContext *s = s1->priv_data;
     uint32_t rtp_ts;
 
-    av_dlog(s1, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
+    av_log(s1, AV_LOG_TRACE, "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},
@@ -304,7 +304,7 @@ void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
 {
     RTPMuxContext *s = s1->priv_data;
 
-    av_dlog(s1, "rtp_send_data size=%d\n", len);
+    av_log(s1, AV_LOG_TRACE, "rtp_send_data size=%d\n", len);
 
     /* build the RTP header */
     avio_w8(s1->pb, RTP_VERSION << 6);
@@ -492,7 +492,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
     int rtcp_bytes;
     int size= pkt->size;
 
-    av_dlog(s1, "%d: write len=%d\n", pkt->stream_index, size);
+    av_log(s1, AV_LOG_TRACE, "%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 29064ad..70b948d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -380,7 +380,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
     struct sockaddr_storage sdp_ip;
     int ttl;
 
-    av_dlog(s, "sdp: %c='%s'\n", letter, buf);
+    av_log(s, AV_LOG_TRACE, "sdp: %c='%s'\n", letter, buf);
 
     p = buf;
     if (s1->skip_media && letter != 'm')
@@ -1106,7 +1106,7 @@ void ff_rtsp_skip_packet(AVFormatContext *s)
         return;
     len = AV_RB16(buf + 1);
 
-    av_dlog(s, "skipping RTP packet len=%d\n", len);
+    av_log(s, AV_LOG_TRACE, "skipping RTP packet len=%d\n", len);
 
     /* skip payload */
     while (len > 0) {
@@ -1143,7 +1143,7 @@ start:
         q = buf;
         for (;;) {
             ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1);
-            av_dlog(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
+            av_log(s, AV_LOG_TRACE, "ret=%d c=%02x [%c]\n", ret, ch, ch);
             if (ret != 1)
                 return AVERROR_EOF;
             if (ch == '\n')
@@ -1161,7 +1161,7 @@ start:
         }
         *q = '\0';
 
-        av_dlog(s, "line='%s'\n", buf);
+        av_log(s, AV_LOG_TRACE, "line='%s'\n", buf);
 
         /* test if last line */
         if (buf[0] == '\0')
@@ -1313,7 +1313,7 @@ static int rtsp_send_cmd_with_content_async(AVFormatContext *s,
         out_buf = base64buf;
     }
 
-    av_dlog(s, "Sending:\n%s--\n", buf);
+    av_log(s, AV_LOG_TRACE, "Sending:\n%s--\n", buf);
 
     ffurl_write(rt->rtsp_hd_out, out_buf, strlen(out_buf));
     if (send_content_length > 0 && send_content) {
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index bb9c674..4b4ae9c 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -113,7 +113,7 @@ static int rtsp_send_reply(AVFormatContext *s, enum RTSPStatusCode code,
     if (extracontent)
         av_strlcat(message, extracontent, sizeof(message));
     av_strlcat(message, "\r\n", sizeof(message));
-    av_dlog(s, "Sending response:\n%s", message);
+    av_log(s, AV_LOG_TRACE, "Sending response:\n%s", message);
     ffurl_write(rt->rtsp_hd_out, message, strlen(message));
 
     return 0;
@@ -149,7 +149,7 @@ static inline int rtsp_read_request(AVFormatContext *s,
         if (ret)
             return ret;
         if (rbuflen > 1) {
-            av_dlog(s, "Parsing[%d]: %s\n", rbuflen, rbuf);
+            av_log(s, AV_LOG_TRACE, "Parsing[%d]: %s\n", rbuflen, rbuf);
             ff_rtsp_parse_line(request, rbuf, rt, method);
         }
     } while (rbuflen > 0);
@@ -292,7 +292,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
             snprintf(buf, sizeof(buf), "%d", rt->buffer_size);
             av_dict_set(&opts, "buffer_size", buf, 0);
             ff_url_join(url, sizeof(url), "rtp", NULL, host, localport, NULL);
-            av_dlog(s, "Opening: %s", url);
+            av_log(s, AV_LOG_TRACE, "Opening: %s", url);
             ret = ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
                              &s->interrupt_callback, &opts);
             av_dict_free(&opts);
@@ -304,7 +304,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
             return ret;
         }
 
-        av_dlog(s, "Listening on: %d",
+        av_log(s, AV_LOG_TRACE, "Listening on: %d",
                 ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle));
         if ((ret = ff_rtsp_open_transport_ctx(s, rtsp_st))) {
             rtsp_send_reply(s, RTSP_STATUS_TRANSPORT, NULL, request.seq);
@@ -750,7 +750,7 @@ int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
     int id, len, i, ret;
     RTSPStream *rtsp_st;
 
-    av_dlog(s, "tcp_read_packet:\n");
+    av_log(s, AV_LOG_TRACE, "tcp_read_packet:\n");
 redo:
     for (;;) {
         RTSPMessageHeader reply;
@@ -769,7 +769,7 @@ redo:
         return -1;
     id  = buf[0];
     len = AV_RB16(buf + 1);
-    av_dlog(s, "id=%d len=%d\n", id, len);
+    av_log(s, AV_LOG_TRACE, "id=%d len=%d\n", id, len);
     if (len > buf_size || len < 12)
         goto redo;
     /* get the data */
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c275d06..b4ef77d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -652,7 +652,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
         pkt->pts > pkt->dts)
         presentation_delayed = 1;
 
-    av_dlog(NULL,
+    av_log(NULL, AV_LOG_TRACE,
             "IN delayed:%d pts:%"PRId64", dts:%"PRId64" "
             "cur_dts:%"PRId64" st:%d pc:%p\n",
             presentation_delayed, pkt->pts, pkt->dts, st->cur_dts,
@@ -728,7 +728,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
             st->cur_dts = pkt->dts;
     }
 
-    av_dlog(NULL,
+    av_log(NULL, AV_LOG_TRACE,
             "OUTdelayed:%d/%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64"\n",
             presentation_delayed, delay, pkt->pts, pkt->dts, st->cur_dts);
 
@@ -1220,7 +1220,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
     if (stream_index < 0)
         return -1;
 
-    av_dlog(s, "read_seek: %d %"PRId64"\n", stream_index, target_ts);
+    av_log(s, AV_LOG_TRACE, "read_seek: %d %"PRId64"\n", stream_index, target_ts);
 
     ts_max =
     ts_min = AV_NOPTS_VALUE;
@@ -1240,7 +1240,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
         if (e->timestamp <= target_ts || e->pos == e->min_distance) {
             pos_min = e->pos;
             ts_min  = e->timestamp;
-            av_dlog(s, "using cached pos_min=0x%"PRIx64" dts_min=%"PRId64"\n",
+            av_log(s, AV_LOG_TRACE, "using cached pos_min=0x%"PRIx64" dts_min=%"PRId64"\n",
                     pos_min, ts_min);
         } else {
             assert(index == 0);
@@ -1255,7 +1255,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
             pos_max   = e->pos;
             ts_max    = e->timestamp;
             pos_limit = pos_max - e->min_distance;
-            av_dlog(s, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64
+            av_log(s, AV_LOG_TRACE, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64
                     " dts_max=%"PRId64"\n", pos_max, pos_limit, ts_max);
         }
     }
@@ -1285,7 +1285,7 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
     int64_t start_pos, filesize;
     int no_change;
 
-    av_dlog(s, "gen_seek: %d %"PRId64"\n", stream_index, target_ts);
+    av_log(s, AV_LOG_TRACE, "gen_seek: %d %"PRId64"\n", stream_index, target_ts);
 
     if (ts_min == AV_NOPTS_VALUE) {
         pos_min = s->internal->data_offset;
@@ -1328,7 +1328,7 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
 
     no_change = 0;
     while (pos_min < pos_limit) {
-        av_dlog(s, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%"PRId64
+        av_log(s, AV_LOG_TRACE, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%"PRId64
                 " dts_max=%"PRId64"\n", pos_min, pos_max, ts_min, ts_max);
         assert(pos_limit <= pos_max);
 
@@ -1358,7 +1358,7 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
             no_change++;
         else
             no_change = 0;
-        av_dlog(s, "%"PRId64" %"PRId64" %"PRId64" / %"PRId64" %"PRId64" %"PRId64
+        av_log(s, AV_LOG_TRACE, "%"PRId64" %"PRId64" %"PRId64" / %"PRId64" %"PRId64" %"PRId64
                 " target:%"PRId64" limit:%"PRId64" start:%"PRId64" noc:%d\n",
                 pos_min, pos, pos_max, ts_min, ts, ts_max, target_ts,
                 pos_limit, start_pos, no_change);
@@ -1384,7 +1384,7 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
     ts_min  = read_timestamp(s, stream_index, &pos_min, INT64_MAX);
     pos_min++;
     ts_max = read_timestamp(s, stream_index, &pos_min, INT64_MAX);
-    av_dlog(s, "pos=0x%"PRIx64" %"PRId64"<=%"PRId64"<=%"PRId64"\n",
+    av_log(s, AV_LOG_TRACE, "pos=0x%"PRIx64" %"PRId64"<=%"PRId64"<=%"PRId64"\n",
             pos, ts_min, target_ts, ts_max);
     *ts_ret = ts;
     return pos;
@@ -1796,11 +1796,11 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
         AVStream av_unused *st;
         for (i = 0; i < ic->nb_streams; i++) {
             st = ic->streams[i];
-            av_dlog(ic, "%d: start_time: %0.3f duration: %0.3f\n", i,
+            av_log(ic, AV_LOG_TRACE, "%d: start_time: %0.3f duration: %0.3f\n", i,
                     (double) st->start_time / AV_TIME_BASE,
                     (double) st->duration   / AV_TIME_BASE);
         }
-        av_dlog(ic,
+        av_log(ic, AV_LOG_TRACE,
                 "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
                 (double) ic->start_time / AV_TIME_BASE,
                 (double) ic->duration   / AV_TIME_BASE,
@@ -2568,7 +2568,7 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
     AVProgram *program = NULL;
     int i;
 
-    av_dlog(ac, "new_program: id=0x%04x\n", id);
+    av_log(ac, AV_LOG_TRACE, "new_program: id=0x%04x\n", id);
 
     for (i = 0; i < ac->nb_programs; i++)
         if (ac->programs[i]->id == id)
diff --git a/libavresample/audio_convert.c b/libavresample/audio_convert.c
index ef23912..eabcd86 100644
--- a/libavresample/audio_convert.c
+++ b/libavresample/audio_convert.c
@@ -319,7 +319,7 @@ int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in)
 
     if (ac->dc) {
         /* dithered conversion */
-        av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (dithered)\n",
+        av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n",
                 len, av_get_sample_fmt_name(ac->in_fmt),
                 av_get_sample_fmt_name(ac->out_fmt));
 
@@ -337,7 +337,7 @@ int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in)
             use_generic = 0;
         }
     }
-    av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (%s)\n", len,
+    av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\n", len,
             av_get_sample_fmt_name(ac->in_fmt),
             av_get_sample_fmt_name(ac->out_fmt),
             use_generic ? ac->func_descr_generic : ac->func_descr);
diff --git a/libavresample/audio_mix.c b/libavresample/audio_mix.c
index 8619c1a..8ff82a2 100644
--- a/libavresample/audio_mix.c
+++ b/libavresample/audio_mix.c
@@ -441,7 +441,7 @@ int ff_audio_mix(AudioMix *am, AudioData *src)
             use_generic = 0;
         }
     }
-    av_dlog(am->avr, "audio_mix: %d samples - %d to %d channels (%s)\n",
+    av_log(am->avr, AV_LOG_TRACE, "audio_mix: %d samples - %d to %d channels (%s)\n",
             src->nb_samples, am->in_channels, am->out_channels,
             use_generic ? am->func_descr_generic : am->func_descr);
 
diff --git a/libavresample/resample.c b/libavresample/resample.c
index dd0ea13..bf766a2 100644
--- a/libavresample/resample.c
+++ b/libavresample/resample.c
@@ -485,7 +485,7 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src)
     ff_audio_data_drain(c->buffer, consumed);
     c->initial_padding_samples = FFMAX(c->initial_padding_samples - consumed, 0);
 
-    av_dlog(c->avr, "resampled %d in + %d leftover to %d out + %d leftover\n",
+    av_log(c->avr, AV_LOG_TRACE, "resampled %d in + %d leftover to %d out + %d leftover\n",
             in_samples, in_leftover, out_samples, c->buffer->nb_samples);
 
     dst->nb_samples = out_samples;
diff --git a/libavresample/utils.c b/libavresample/utils.c
index 8ba8a09..172aadb 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -127,46 +127,46 @@ int avresample_open(AVAudioResampleContext *avr)
     if (avr->use_channel_map) {
         if (avr->in_copy_needed) {
             avr->remap_point = REMAP_IN_COPY;
-            av_dlog(avr, "remap channels during in_copy\n");
+            av_log(avr, AV_LOG_TRACE, "remap channels during in_copy\n");
         } else if (avr->in_convert_needed) {
             avr->remap_point = REMAP_IN_CONVERT;
-            av_dlog(avr, "remap channels during in_convert\n");
+            av_log(avr, AV_LOG_TRACE, "remap channels during in_convert\n");
         } else if (avr->out_convert_needed) {
             avr->remap_point = REMAP_OUT_CONVERT;
-            av_dlog(avr, "remap channels during out_convert\n");
+            av_log(avr, AV_LOG_TRACE, "remap channels during out_convert\n");
         } else {
             avr->remap_point = REMAP_OUT_COPY;
-            av_dlog(avr, "remap channels during out_copy\n");
+            av_log(avr, AV_LOG_TRACE, "remap channels during out_copy\n");
         }
 
 #ifdef DEBUG
         {
             int ch;
-            av_dlog(avr, "output map: ");
+            av_log(avr, AV_LOG_TRACE, "output map: ");
             if (avr->ch_map_info.do_remap)
                 for (ch = 0; ch < avr->in_channels; ch++)
-                    av_dlog(avr, " % 2d", avr->ch_map_info.channel_map[ch]);
+                    av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.channel_map[ch]);
             else
-                av_dlog(avr, "n/a");
-            av_dlog(avr, "\n");
-            av_dlog(avr, "copy map:   ");
+                av_log(avr, AV_LOG_TRACE, "n/a");
+            av_log(avr, AV_LOG_TRACE, "\n");
+            av_log(avr, AV_LOG_TRACE, "copy map:   ");
             if (avr->ch_map_info.do_copy)
                 for (ch = 0; ch < avr->in_channels; ch++)
-                    av_dlog(avr, " % 2d", avr->ch_map_info.channel_copy[ch]);
+                    av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.channel_copy[ch]);
             else
-                av_dlog(avr, "n/a");
-            av_dlog(avr, "\n");
-            av_dlog(avr, "zero map:   ");
+                av_log(avr, AV_LOG_TRACE, "n/a");
+            av_log(avr, AV_LOG_TRACE, "\n");
+            av_log(avr, AV_LOG_TRACE, "zero map:   ");
             if (avr->ch_map_info.do_zero)
                 for (ch = 0; ch < avr->in_channels; ch++)
-                    av_dlog(avr, " % 2d", avr->ch_map_info.channel_zero[ch]);
+                    av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.channel_zero[ch]);
             else
-                av_dlog(avr, "n/a");
-            av_dlog(avr, "\n");
-            av_dlog(avr, "input map:  ");
+                av_log(avr, AV_LOG_TRACE, "n/a");
+            av_log(avr, AV_LOG_TRACE, "\n");
+            av_log(avr, AV_LOG_TRACE, "input map:  ");
             for (ch = 0; ch < avr->in_channels; ch++)
-                av_dlog(avr, " % 2d", avr->ch_map_info.input_map[ch]);
-            av_dlog(avr, "\n");
+                av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.input_map[ch]);
+            av_log(avr, AV_LOG_TRACE, "\n");
         }
 #endif
     } else
@@ -295,7 +295,7 @@ static int handle_buffered_output(AVAudioResampleContext *avr,
             /* if there are any samples in the output FIFO or if the
                user-supplied output buffer is not large enough for all samples,
                we add to the output FIFO */
-            av_dlog(avr, "[FIFO] add %s to out_fifo\n", converted->name);
+            av_log(avr, AV_LOG_TRACE, "[FIFO] add %s to out_fifo\n", converted->name);
             ret = ff_audio_data_add_to_fifo(avr->out_fifo, converted, 0,
                                             converted->nb_samples);
             if (ret < 0)
@@ -305,25 +305,25 @@ static int handle_buffered_output(AVAudioResampleContext *avr,
         /* if the user specified an output buffer, read samples from the output
            FIFO to the user output */
         if (output && output->allocated_samples > 0) {
-            av_dlog(avr, "[FIFO] read from out_fifo to output\n");
-            av_dlog(avr, "[end conversion]\n");
+            av_log(avr, AV_LOG_TRACE, "[FIFO] read from out_fifo to output\n");
+            av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
             return ff_audio_data_read_from_fifo(avr->out_fifo, output,
                                                 output->allocated_samples);
         }
     } else if (converted) {
         /* copy directly to output if it is large enough or there is not any
            data in the output FIFO */
-        av_dlog(avr, "[copy] %s to output\n", converted->name);
+        av_log(avr, AV_LOG_TRACE, "[copy] %s to output\n", converted->name);
         output->nb_samples = 0;
         ret = ff_audio_data_copy(output, converted,
                                  avr->remap_point == REMAP_OUT_COPY ?
                                  &avr->ch_map_info : NULL);
         if (ret < 0)
             return ret;
-        av_dlog(avr, "[end conversion]\n");
+        av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
         return output->nb_samples;
     }
-    av_dlog(avr, "[end conversion]\n");
+    av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
     return 0;
 }
 
@@ -354,7 +354,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
                                    avr->out_buffer->allocated_channels);
     }
 
-    av_dlog(avr, "[start conversion]\n");
+    av_log(avr, AV_LOG_TRACE, "[start conversion]\n");
 
     /* initialize output_buffer with output data */
     direct_output = output && av_audio_fifo_size(avr->out_fifo) == 0;
@@ -380,7 +380,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
             !avr->out_convert_needed && direct_output && out_samples >= in_samples) {
             /* in some rare cases we can copy input to output and upmix
                directly in the output buffer */
-            av_dlog(avr, "[copy] %s to output\n", current_buffer->name);
+            av_log(avr, AV_LOG_TRACE, "[copy] %s to output\n", current_buffer->name);
             ret = ff_audio_data_copy(&output_buffer, current_buffer,
                                      avr->remap_point == REMAP_OUT_COPY ?
                                      &avr->ch_map_info : NULL);
@@ -392,7 +392,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
             /* if remapping channels during output copy, we may need to
              * use an intermediate buffer in order to remap before adding
              * samples to the output fifo */
-            av_dlog(avr, "[copy] %s to out_buffer\n", current_buffer->name);
+            av_log(avr, AV_LOG_TRACE, "[copy] %s to out_buffer\n", current_buffer->name);
             ret = ff_audio_data_copy(avr->out_buffer, current_buffer,
                                      &avr->ch_map_info);
             if (ret < 0)
@@ -406,13 +406,13 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
                                             current_buffer->nb_samples);
                 if (ret < 0)
                     return ret;
-                av_dlog(avr, "[convert] %s to in_buffer\n", current_buffer->name);
+                av_log(avr, AV_LOG_TRACE, "[convert] %s to in_buffer\n", current_buffer->name);
                 ret = ff_audio_convert(avr->ac_in, avr->in_buffer,
                                        current_buffer);
                 if (ret < 0)
                     return ret;
             } else {
-                av_dlog(avr, "[copy] %s to in_buffer\n", current_buffer->name);
+                av_log(avr, AV_LOG_TRACE, "[copy] %s to in_buffer\n", current_buffer->name);
                 ret = ff_audio_data_copy(avr->in_buffer, current_buffer,
                                          avr->remap_point == REMAP_IN_COPY ?
                                          &avr->ch_map_info : NULL);
@@ -421,7 +421,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
             }
             ff_audio_data_set_channels(avr->in_buffer, avr->in_channels);
             if (avr->downmix_needed) {
-                av_dlog(avr, "[downmix] in_buffer\n");
+                av_log(avr, AV_LOG_TRACE, "[downmix] in_buffer\n");
                 ret = ff_audio_mix(avr->am, avr->in_buffer);
                 if (ret < 0)
                     return ret;
@@ -443,7 +443,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
             resample_out = &output_buffer;
         else
             resample_out = avr->resample_out_buffer;
-        av_dlog(avr, "[resample] %s to %s\n",
+        av_log(avr, AV_LOG_TRACE, "[resample] %s to %s\n",
                 current_buffer ? current_buffer->name : "null",
                 resample_out->name);
         ret = ff_audio_resample(avr->resample, resample_out,
@@ -453,7 +453,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
 
         /* if resampling did not produce any samples, just return 0 */
         if (resample_out->nb_samples == 0) {
-            av_dlog(avr, "[end conversion]\n");
+            av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
             return 0;
         }
 
@@ -461,7 +461,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
     }
 
     if (avr->upmix_needed) {
-        av_dlog(avr, "[upmix] %s\n", current_buffer->name);
+        av_log(avr, AV_LOG_TRACE, "[upmix] %s\n", current_buffer->name);
         ret = ff_audio_mix(avr->am, current_buffer);
         if (ret < 0)
             return ret;
@@ -469,26 +469,26 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
 
     /* if we resampled or upmixed directly to output, return here */
     if (current_buffer == &output_buffer) {
-        av_dlog(avr, "[end conversion]\n");
+        av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
         return current_buffer->nb_samples;
     }
 
     if (avr->out_convert_needed) {
         if (direct_output && out_samples >= current_buffer->nb_samples) {
             /* convert directly to output */
-            av_dlog(avr, "[convert] %s to output\n", current_buffer->name);
+            av_log(avr, AV_LOG_TRACE, "[convert] %s to output\n", current_buffer->name);
             ret = ff_audio_convert(avr->ac_out, &output_buffer, current_buffer);
             if (ret < 0)
                 return ret;
 
-            av_dlog(avr, "[end conversion]\n");
+            av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
             return output_buffer.nb_samples;
         } else {
             ret = ff_audio_data_realloc(avr->out_buffer,
                                         current_buffer->nb_samples);
             if (ret < 0)
                 return ret;
-            av_dlog(avr, "[convert] %s to out_buffer\n", current_buffer->name);
+            av_log(avr, AV_LOG_TRACE, "[convert] %s to out_buffer\n", current_buffer->name);
             ret = ff_audio_convert(avr->ac_out, avr->out_buffer,
                                    current_buffer);
             if (ret < 0)



More information about the ffmpeg-cvslog mailing list