matroskadec: export mimetype of attachments as metadata.
authorAnton Khirnov <anton@khirnov.net>
Tue, 27 Sep 2011 08:36:53 +0000 (10:36 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 27 Sep 2011 13:26:36 +0000 (15:26 +0200)
libavformat/matroskadec.c

index 01c9a7b..af5532b 100644 (file)
@@ -1555,6 +1555,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
             if (st == NULL)
                 break;
             av_dict_set(&st->metadata, "filename",attachements[j].filename, 0);
             if (st == NULL)
                 break;
             av_dict_set(&st->metadata, "filename",attachements[j].filename, 0);
+            av_dict_set(&st->metadata, "mimetype", attachements[j].mime, 0);
             st->codec->codec_id = CODEC_ID_NONE;
             st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
             st->codec->extradata  = av_malloc(attachements[j].bin.size);
             st->codec->codec_id = CODEC_ID_NONE;
             st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
             st->codec->extradata  = av_malloc(attachements[j].bin.size);