[FFmpeg-cvslog] lavf/movenc: fix writing of some iTunes metadata tag

Matthieu Bouron git at videolan.org
Wed Jul 3 17:22:46 CEST 2013


ffmpeg | branch: master | Matthieu Bouron <matthieu.bouron at gmail.com> | Sat Jun 29 17:56:49 2013 +0200| [4943eff2cd281518461baf89775859e86dd83d0e] | committer: Michael Niedermayer

lavf/movenc: fix writing of some iTunes metadata tag

Fix metadata display under iTunes for files using pgap, hdvd, stick,
tvsn and tves tags.

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

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

 libavformat/movenc.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index c19d58d..5d224bc 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2046,16 +2046,25 @@ static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb,
 {
     AVDictionaryEntry *t = NULL;
     uint8_t num;
+    int size = 24 + len;
+
+    if (len != 1 && len != 4)
+        return -1;
 
     if (!(t = av_dict_get(s->metadata, tag, NULL, 0)))
         return 0;
     num = atoi(t->value);
 
-    avio_wb32(pb, len+8);
+    avio_wb32(pb, size);
     ffio_wfourcc(pb, name);
+    avio_wb32(pb, size - 8);
+    ffio_wfourcc(pb, "data");
+    avio_wb32(pb, 0x15);
+    avio_wb32(pb, 0);
     if (len==4) avio_wb32(pb, num);
     else        avio_w8 (pb, num);
-    return len+8;
+
+    return size;
 }
 
 /* iTunes meta data list */



More information about the ffmpeg-cvslog mailing list