[FFmpeg-devel] [PATCH 12/19] avformat/matroskaenc: Add support for FlagOriginal

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Wed Feb 17 12:13:49 EET 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/matroskaenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 746c0b347a..0dd093ae8b 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1193,6 +1193,12 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
     } else {
         if (st->disposition & AV_DISPOSITION_COMMENT)
             put_ebml_uint(pb, MATROSKA_ID_TRACKFLAGCOMMENTARY, 1);
+        if (st->disposition & (AV_DISPOSITION_ORIGINAL | AV_DISPOSITION_DUB) &&
+            (st->disposition & (AV_DISPOSITION_ORIGINAL | AV_DISPOSITION_DUB))
+                            != (AV_DISPOSITION_ORIGINAL | AV_DISPOSITION_DUB))
+            put_ebml_uint(pb, MATROSKA_ID_TRACKFLAGORIGINAL,
+                          !!(st->disposition & AV_DISPOSITION_ORIGINAL));
+
         // look for a codec ID string specific to mkv to use,
         // if none are found, use AVI codes
         if (par->codec_id != AV_CODEC_ID_RAWVIDEO || par->codec_tag) {
-- 
2.27.0



More information about the ffmpeg-devel mailing list