You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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/#tagging Reviewed-by: Ivan Janatra <janatra@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -1681,6 +1681,7 @@ static int mkv_write_tags(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mkv->mode != MODE_WEBM) {
|
||||||
for (i = 0; i < s->nb_chapters; i++) {
|
for (i = 0; i < s->nb_chapters; i++) {
|
||||||
AVChapter *ch = s->chapters[i];
|
AVChapter *ch = s->chapters[i];
|
||||||
|
|
||||||
@@ -1688,10 +1689,12 @@ static int mkv_write_tags(AVFormatContext *s)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id + mkv->chapter_id_offset, &mkv->tags);
|
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 (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++) {
|
for (i = 0; i < mkv->attachments->num_entries; i++) {
|
||||||
mkv_attachment *attachment = &mkv->attachments->entries[i];
|
mkv_attachment *attachment = &mkv->attachments->entries[i];
|
||||||
AVStream *st = s->streams[attachment->stream_idx];
|
AVStream *st = s->streams[attachment->stream_idx];
|
||||||
@@ -1988,11 +1991,11 @@ static int mkv_write_header(AVFormatContext *s)
|
|||||||
ret = mkv_write_attachments(s);
|
ret = mkv_write_attachments(s);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
ret = mkv_write_tags(s);
|
ret = mkv_write_tags(s);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
|
||||||
|
|
||||||
if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live)
|
if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live)
|
||||||
mkv_write_seekhead(pb, mkv);
|
mkv_write_seekhead(pb, mkv);
|
||||||
|
Reference in New Issue
Block a user