summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-06 15:24:33 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-19 05:02:20 +0200
commit3bd26b285e41a3b759bd00ad634a3163f0e7f88f (patch)
tree94f73c008e018ccda18f9be5b4767d0b6226d353 /libavformat
parent4ebfc13c338423cf48f1a1266c890422367f7775 (diff)
avformat/matroskadec: Export FileDescription as title tag
Each AttachedFile in Matroska can have a FileDescription element that contains a human-friendly name for the attached file; yet this element has been ignored up until now. This commit changes this and exports it as title tag instead (the Matroska muxer mapped the title tag to the AttachedFile element since support for Attachments was added). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index b277c05f9d..4fa32365c3 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -259,6 +259,7 @@ typedef struct MatroskaTrack {
typedef struct MatroskaAttachment {
uint64_t uid;
char *filename;
+ char *description;
char *mime;
EbmlBin bin;
@@ -587,7 +588,7 @@ static EbmlSyntax matroska_attachment[] = {
{ MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) },
{ MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) },
{ MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) },
- { MATROSKA_ID_FILEDESC, EBML_NONE },
+ { MATROSKA_ID_FILEDESC, EBML_UTF8, 0, offsetof(MatroskaAttachment, description) },
CHILD_OF(matroska_attachments)
};
@@ -2914,6 +2915,8 @@ static int matroska_read_header(AVFormatContext *s)
break;
av_dict_set(&st->metadata, "filename", attachments[j].filename, 0);
av_dict_set(&st->metadata, "mimetype", attachments[j].mime, 0);
+ if (attachments[j].description)
+ av_dict_set(&st->metadata, "title", attachments[j].description, 0);
st->codecpar->codec_id = AV_CODEC_ID_NONE;
for (i = 0; mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {