[FFmpeg-cvslog] flvdec: Don't export metadata entries that aren't proper metadata

Martin Storsjö git at videolan.org
Thu Oct 13 06:01:45 CEST 2011


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Oct 12 00:03:20 2011 +0300| [5e87222fd1dd57483c2a566e6643ca601b0e4e0c] | committer: Martin Storsjö

flvdec: Don't export metadata entries that aren't proper metadata

This avoids writing these entries doubly if transcoding from
flv to flv, since the muxer blindly writes any and all metadata
keys set, in addition to the fixed fields that the muxer
always writes.

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/flvdec.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 815618d..d2f3f51 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -296,6 +296,20 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
                 acodec->bit_rate = num_val * 1024.0;
         }
 
+        if (!strcmp(key, "duration")        ||
+            !strcmp(key, "filesize")        ||
+            !strcmp(key, "width")           ||
+            !strcmp(key, "height")          ||
+            !strcmp(key, "videodatarate")   ||
+            !strcmp(key, "framerate")       ||
+            !strcmp(key, "videocodecid")    ||
+            !strcmp(key, "audiodatarate")   ||
+            !strcmp(key, "audiosamplerate") ||
+            !strcmp(key, "audiosamplesize") ||
+            !strcmp(key, "stereo")          ||
+            !strcmp(key, "audiocodecid"))
+            return 0;
+
         if(amf_type == AMF_DATA_TYPE_BOOL) {
             av_strlcpy(str_val, num_val > 0 ? "true" : "false", sizeof(str_val));
             av_dict_set(&s->metadata, key, str_val, 0);



More information about the ffmpeg-cvslog mailing list