[FFmpeg-devel] [PATCH] libavformat/mxfdec.c: Recognize and Ignore MXF fill boxes

Martin Schitter ms+git at mur.at
Wed Sep 11 11:15:11 EEST 2024


This adds support for empty 'fill' boxes while decoding MXF files.
---
 libavformat/mxfdec.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 142b3e6..701fc9f 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -367,6 +367,8 @@ static const uint8_t mxf_mca_rfc5646_spoken_language[]     = { 0x06,0x0e,0x2b,0x
 
 static const uint8_t mxf_sub_descriptor[]                  = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x04,0x06,0x10,0x00,0x00 };
 
+static const uint8_t mxf_fill_key[]                        = { 0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x01,0x02,0x10,0x01,0x00,0x00,0x00 };
+
 static const uint8_t mxf_mastering_display_prefix[13]      = { FF_MXF_MasteringDisplay_PREFIX };
 static const uint8_t mxf_mastering_display_uls[4][16] = {
     FF_MXF_MasteringDisplayPrimaries,
@@ -3730,6 +3732,11 @@ static int mxf_read_header(AVFormatContext *s)
                 continue;
         }
 
+        if (IS_KLV_KEY(klv.key, mxf_fill_key)){
+            avio_skip(s->pb, klv.length);
+            continue;
+        }
+
         PRINT_KEY(s, "read header", klv.key);
         av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
         if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key, sizeof(mxf_encrypted_triplet_key)) ||
-- 
2.45.2



More information about the ffmpeg-devel mailing list