Commit 27b7800b authored by James Almer's avatar James Almer

avformat/matroskaenc: also write tags when output is WebM

WebM supports a subset of elements from the Tags master.
See https://www.webmproject.org/docs/container/#taggingReviewed-by: 's avatarIvan Janatra <janatra@google.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 260ea7a7
......@@ -1681,17 +1681,20 @@ static int mkv_write_tags(AVFormatContext *s)
}
}
for (i = 0; i < s->nb_chapters; i++) {
AVChapter *ch = s->chapters[i];
if (mkv->mode != MODE_WEBM) {
for (i = 0; i < s->nb_chapters; i++) {
AVChapter *ch = s->chapters[i];
if (!mkv_check_tag(ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID))
continue;
if (!mkv_check_tag(ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID))
continue;
ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id + mkv->chapter_id_offset, &mkv->tags);
if (ret < 0) return ret;
ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id + mkv->chapter_id_offset, &mkv->tags);
if (ret < 0)
return ret;
}
}
if (mkv->have_attachments) {
if (mkv->have_attachments && mkv->mode != MODE_WEBM) {
for (i = 0; i < mkv->attachments->num_entries; i++) {
mkv_attachment *attachment = &mkv->attachments->entries[i];
AVStream *st = s->streams[attachment->stream_idx];
......@@ -1988,12 +1991,12 @@ static int mkv_write_header(AVFormatContext *s)
ret = mkv_write_attachments(s);
if (ret < 0)
goto fail;
ret = mkv_write_tags(s);
if (ret < 0)
goto fail;
}
ret = mkv_write_tags(s);
if (ret < 0)
goto fail;
if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live)
mkv_write_seekhead(pb, mkv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment