[FFmpeg-cvslog] rmdec: parse logical-fileinfo, instead of creating phantom tracks

Michael Niedermayer git at videolan.org
Tue Aug 21 06:22:23 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Aug 21 06:15:22 2012 +0200| [62527dc245456b643f2991b32b9aea3a882a2399] | committer: Michael Niedermayer

rmdec: parse logical-fileinfo, instead of creating phantom tracks

Fixes Ticket1090

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

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

 libavformat/rmdec.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 0eadd66..84ebd55 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -321,6 +321,33 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
         st->codec->codec_tag  = AV_RL32(st->codec->extradata);
         st->codec->codec_id   = ff_codec_get_id(ff_rm_codec_tags,
                                                 st->codec->codec_tag);
+    } else if(mime && !strcmp(mime, "logical-fileinfo")){
+        int stream_count, rule_count, property_count, i, type;
+        ff_free_stream(s, st);
+        if (avio_rb16(pb) != 0) {
+            av_log(s, AV_LOG_WARNING, "Unsupported version\n");
+            goto skip;
+        }
+        stream_count = avio_rb16(pb);
+        avio_skip(pb, 6*stream_count);
+        rule_count = avio_rb16(pb);
+        avio_skip(pb, 2*rule_count);
+        property_count = avio_rb16(pb);
+        for(i=0; i<property_count; i++){
+            uint8_t name[128], val[128];
+            avio_rb32(pb);
+            if (avio_rb16(pb) != 0) {
+                av_log(s, AV_LOG_WARNING, "Unsupported Name value property version\n");
+                goto skip; //FIXME skip just this one
+            }
+            get_str8(pb, name, sizeof(name));
+            switch(avio_rb32(pb)) {
+            case 2: get_strl(pb, val, sizeof(val), avio_rb16(pb));
+                av_dict_set(&s->metadata, name, val, 0);
+                break;
+            default: avio_skip(pb, avio_rb16(pb));
+            }
+        }
     } else {
         int fps;
         if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {



More information about the ffmpeg-cvslog mailing list