From c0b88f1920ce100e49ec2fdacff327e97a7b3c27 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Wed, 12 Aug 2009 13:17:39 +0000 Subject: [PATCH] Moves the display of metadata to dump_format() Originally committed as revision 19632 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffplay.c | 8 -------- libavformat/utils.c | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ffplay.c b/ffplay.c index 6077e6c050..814efc5215 100644 --- a/ffplay.c +++ b/ffplay.c @@ -1860,13 +1860,6 @@ static void stream_component_close(VideoState *is, int stream_index) } } -static void dump_stream_info(const AVFormatContext *s) -{ - AVMetadataTag *tag = NULL; - while ((tag=av_metadata_get(s->metadata,"",tag,AV_METADATA_IGNORE_SUFFIX))) - fprintf(stderr, "%s: %s\n", tag->key, tag->value); -} - /* since we have only one decoding thread, we can use a global variable instead of a thread local variable */ static VideoState *global_video_state; @@ -1960,7 +1953,6 @@ static int decode_thread(void *arg) } if (show_status) { dump_format(ic, 0, is->filename, 0); - dump_stream_info(ic); } /* open the streams */ diff --git a/libavformat/utils.c b/libavformat/utils.c index 0c1a50d816..b9f6c004c9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2916,6 +2916,14 @@ void dump_format(AVFormatContext *ic, } else for(i=0;inb_streams;i++) dump_stream_format(ic, i, index, is_output); + if (ic->metadata) { + AVMetadataTag *tag=NULL; + av_log(NULL, AV_LOG_INFO, " Metadata\n"); + while((tag=av_metadata_get(ic->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) { + av_log(NULL, AV_LOG_INFO, " %-16s: %s\n", tag->key, tag->value); + } + } + } #if LIBAVFORMAT_VERSION_MAJOR < 53