PR #26151 opened by Baptiste Coudurier (bcoudurier)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26151
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26151.patch

Index table fixes for the MXF muxer, following ST 377-1:

- OPAtom has no system item: write a single delta entry at offset 0 (11.1.4).
- Element deltas now include the 20 byte KLV key and length of the preceding 
elements (11.1.4).
- Index tables larger than 64 KiB are split into segments instead of 
overflowing the 2 byte IndexEntryArray local length (11.2).
- The CBE IndexByteCount is computed from the segment that is written instead 
of being hardcoded (7.1).
- No index slices when the picture is the last element (11.1.4).

Each commit builds on its own and updates the refs it changes; FATE passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)



From a168b10e89bb25d5e8a3972a19087702242e64d9 Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <[email protected]>
Date: Fri, 13 Nov 2026 16:22:33 -0800
Subject: [PATCH 1/5] avformat/mxfenc: do not index a system item in OPAtom

OPAtom has no system item, write a single delta entry at offset 0.

Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavformat/mxfenc.c                    | 25 +++++++++++++++++--------
 tests/ref/fate/mxf-opatom-user-comments |  2 +-
 tests/ref/lavf/mxf_opatom               |  2 +-
 tests/ref/lavf/mxf_opatom_audio         |  2 +-
 4 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 66528d5e358..26325dfffc9 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2011,6 +2011,12 @@ static unsigned klv_fill_size(uint64_t size)
         return pad & (KAG_SIZE-1);
 }
 
+static int mxf_index_delta_count(AVFormatContext *s)
+{
+    // one delta entry per element, plus the system item except in OPAtom
+    return s->nb_streams + !IS_OPATOM(s);
+}
+
 static int mxf_check_frame_offset(AVFormatContext *s, int offset)
 {
     if (offset >= INT8_MIN && offset <= INT8_MAX)
@@ -2081,13 +2087,15 @@ static int 
mxf_write_index_table_segment(AVFormatContext *s)
     avio_w8(pb, !mxf->edit_unit_byte_count); // only one slice for CBR
 
     // delta entry array
-    mxf_write_local_tag(s, 8 + (s->nb_streams+1)*6, 0x3F09);
-    avio_wb32(pb, s->nb_streams+1); // num of entries
+    mxf_write_local_tag(s, 8 + mxf_index_delta_count(s)*6, 0x3F09);
+    avio_wb32(pb, mxf_index_delta_count(s)); // num of entries
     avio_wb32(pb, 6);               // size of one entry
-    // write system item delta entry
-    avio_w8(pb, 0);
-    avio_w8(pb, 0); // slice entry
-    avio_wb32(pb, 0); // element delta
+    if (!IS_OPATOM(s)) {
+        // write system item delta entry
+        avio_w8(pb, 0);
+        avio_w8(pb, 0); // slice entry
+        avio_wb32(pb, 0); // element delta
+    }
     // write each stream delta entry
     for (i = 0; i < s->nb_streams; i++) {
         AVStream *st = s->streams[i];
@@ -2100,7 +2108,8 @@ static int mxf_write_index_table_segment(AVFormatContext 
*s)
             avio_wb32(pb, sc->slice_offset);
         } else if (i == 0) { // video track
             avio_w8(pb, 0); // slice number
-            avio_wb32(pb, KAG_SIZE); // system item size including klv fill
+            // system item size including klv fill, no system item in OPAtom
+            avio_wb32(pb, IS_OPATOM(s) ? 0 : KAG_SIZE);
         } else { // audio or data track
             if (!audio_frame_size) {
                 audio_frame_size = sc->frame_size;
@@ -2207,7 +2216,7 @@ static int mxf_write_partition(AVFormatContext *s, int 
bodysid,
     int err;
 
     if (!mxf->edit_unit_byte_count && mxf->edit_units_count)
-        index_byte_count = 85 + 12+(s->nb_streams+1)*6 +
+        index_byte_count = 85 + 12+mxf_index_delta_count(s)*6 +
             12+mxf->edit_units_count*15;
     else if (mxf->edit_unit_byte_count && indexsid)
         index_byte_count = 80;
diff --git a/tests/ref/fate/mxf-opatom-user-comments 
b/tests/ref/fate/mxf-opatom-user-comments
index 14a1cee1f26..66afabf2e24 100644
--- a/tests/ref/fate/mxf-opatom-user-comments
+++ b/tests/ref/fate/mxf-opatom-user-comments
@@ -1 +1 @@
-d40b64e492133c74faa07e605eb65b2f
+b3191be3ec3f84e5d756f86a51cc2b20
diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom
index fa722418139..4e6cc51470f 100644
--- a/tests/ref/lavf/mxf_opatom
+++ b/tests/ref/lavf/mxf_opatom
@@ -1,3 +1,3 @@
-6418766ca9b8b23fae74a80d66f26f3e *tests/data/lavf/lavf.mxf_opatom
+491ec08f32738efd10ba2671746fae4d *tests/data/lavf/lavf.mxf_opatom
 4717625 tests/data/lavf/lavf.mxf_opatom
 tests/data/lavf/lavf.mxf_opatom CRC=0xb13ba2f8
diff --git a/tests/ref/lavf/mxf_opatom_audio b/tests/ref/lavf/mxf_opatom_audio
index 0e034991c00..58343a7a51f 100644
--- a/tests/ref/lavf/mxf_opatom_audio
+++ b/tests/ref/lavf/mxf_opatom_audio
@@ -1,3 +1,3 @@
-633b6d373009416f214edcf456208580 *tests/data/lavf/lavf.mxf_opatom_audio
+36bdc33f00f5014d1c276cd5438e9cf1 *tests/data/lavf/lavf.mxf_opatom_audio
 102969 tests/data/lavf/lavf.mxf_opatom_audio
 tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff
-- 
2.54.0


From acbe4839f91bba62e39fcdf730c2015d204fce4c Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <[email protected]>
Date: Fri, 13 Nov 2026 16:23:07 -0800
Subject: [PATCH 2/5] avformat/mxfenc: include the KLV key and length in the
 element delta

Element deltas were missing the 20 byte key and length of the
preceding elements, accumulate the real element strides.

Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavformat/mxfenc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 26325dfffc9..ccb891646fd 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2036,7 +2036,7 @@ static int mxf_write_index_table_segment(AVFormatContext 
*s)
     int i, j, temporal_reordering = 0;
     int key_index = mxf->last_key_index;
     int prev_non_b_picture = 0;
-    int audio_frame_size = 0;
+    unsigned element_delta = 0;
     int64_t pos;
     int err;
 
@@ -2111,12 +2111,11 @@ static int 
mxf_write_index_table_segment(AVFormatContext *s)
             // system item size including klv fill, no system item in OPAtom
             avio_wb32(pb, IS_OPATOM(s) ? 0 : KAG_SIZE);
         } else { // audio or data track
-            if (!audio_frame_size) {
-                audio_frame_size = sc->frame_size;
-                audio_frame_size += klv_fill_size(audio_frame_size);
-            }
             avio_w8(pb, 1);
-            avio_wb32(pb, (i-1)*audio_frame_size); // element delta
+            avio_wb32(pb, element_delta);
+            // each element is KAG aligned and starts with its 16 byte key and 
4 byte length
+            element_delta += 16 + 4 + sc->frame_size;
+            element_delta += klv_fill_size(element_delta);
         }
     }
 
-- 
2.54.0


From 9c7bf3183b0f50c176de9b1aa42a6c1e509a35bf Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <[email protected]>
Date: Fri, 13 Nov 2026 16:24:41 -0800
Subject: [PATCH 3/5] avformat/mxfenc: split index tables larger than 64 KiB

The IndexEntryArray 2 byte local length overflowed past 4368 entries,
segment the index table instead, as ST 377-1 11.2 recommends.

Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavformat/mxfenc.c | 97 ++++++++++++++++++++++++++------------------
 1 file changed, 58 insertions(+), 39 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index ccb891646fd..016e841845c 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2011,6 +2011,10 @@ static unsigned klv_fill_size(uint64_t size)
         return pad & (KAG_SIZE-1);
 }
 
+#define MXF_INDEX_ENTRY_SIZE 15
+// largest IndexEntryArray fitting a 2 byte local set length
+#define MXF_INDEX_MAX_ENTRIES ((UINT16_MAX - 8) / MXF_INDEX_ENTRY_SIZE)
+
 static int mxf_index_delta_count(AVFormatContext *s)
 {
     // one delta entry per element, plus the system item except in OPAtom
@@ -2029,30 +2033,28 @@ static int mxf_check_frame_offset(AVFormatContext *s, 
int offset)
     return AVERROR_PATCHWELCOME;
 }
 
-static int mxf_write_index_table_segment(AVFormatContext *s)
+// Fixed local tags and DeltaEntryArray, excluding the KLV key and length.
+static unsigned mxf_index_header_size(AVFormatContext *s)
+{
+    return 85 + 12 + 6 * mxf_index_delta_count(s);
+}
+
+static void mxf_write_index_table_segment_header(AVFormatContext *s, int64_t 
start, int duration)
 {
     MXFContext *mxf = s->priv_data;
     AVIOContext *pb = s->pb;
-    int i, j, temporal_reordering = 0;
-    int key_index = mxf->last_key_index;
-    int prev_non_b_picture = 0;
     unsigned element_delta = 0;
-    int64_t pos;
-    int err;
-
-    av_log(s, AV_LOG_DEBUG, "edit units count %d\n", mxf->edit_units_count);
-
-    if (!mxf->edit_units_count && !mxf->edit_unit_byte_count)
-        return 0;
+    unsigned size = mxf_index_header_size(s);
+    int i;
 
+    if (duration)
+        size += 12 + duration * MXF_INDEX_ENTRY_SIZE;
     avio_write(pb, index_table_segment_key, 16);
-
-    klv_encode_ber4_length(pb, 0);
-    pos = avio_tell(pb);
+    klv_encode_ber4_length(pb, size);
 
     // instance id
     mxf_write_local_tag(s, 16, 0x3C0A);
-    mxf_write_uuid(pb, IndexTableSegment, mxf->last_indexed_edit_unit);
+    mxf_write_uuid(pb, IndexTableSegment, start);
 
     // index edit rate
     mxf_write_local_tag(s, 8, 0x3F0B);
@@ -2061,14 +2063,11 @@ static int 
mxf_write_index_table_segment(AVFormatContext *s)
 
     // index start position
     mxf_write_local_tag(s, 8, 0x3F0C);
-    avio_wb64(pb, mxf->last_indexed_edit_unit);
+    avio_wb64(pb, start);
 
-    // index duration
+    // index duration, 0 if the index table covers whole container
     mxf_write_local_tag(s, 8, 0x3F0D);
-    if (mxf->edit_unit_byte_count)
-        avio_wb64(pb, 0); // index table covers whole container
-    else
-        avio_wb64(pb, mxf->edit_units_count);
+    avio_wb64(pb, duration);
 
     // edit unit byte count
     mxf_write_local_tag(s, 4, 0x3F05);
@@ -2101,8 +2100,6 @@ static int mxf_write_index_table_segment(AVFormatContext 
*s)
         AVStream *st = s->streams[i];
         MXFStreamContext *sc = st->priv_data;
         avio_w8(pb, sc->temporal_reordering);
-        if (sc->temporal_reordering)
-            temporal_reordering = 1;
         if (mxf->edit_unit_byte_count) {
             avio_w8(pb, 0); // slice number
             avio_wb32(pb, sc->slice_offset);
@@ -2118,23 +2115,47 @@ static int 
mxf_write_index_table_segment(AVFormatContext *s)
             element_delta += klv_fill_size(element_delta);
         }
     }
+}
 
-    if (!mxf->edit_unit_byte_count) {
+static int mxf_write_index_table_segment(AVFormatContext *s)
+{
+    MXFContext *mxf = s->priv_data;
+    AVIOContext *pb = s->pb;
+    int i, j;
+    int key_index = mxf->last_key_index;
+    int prev_non_b_picture = 0;
+    int err;
+
+    av_log(s, AV_LOG_DEBUG, "edit units count %d\n", mxf->edit_units_count);
+
+    if (!mxf->edit_units_count && !mxf->edit_unit_byte_count)
+        return 0;
+
+    if (mxf->edit_unit_byte_count) {
+        mxf_write_index_table_segment_header(s, mxf->last_indexed_edit_unit, 
0);
+    } else {
         MXFStreamContext *sc = s->streams[0]->priv_data;
-        mxf_write_local_tag(s, 8 + mxf->edit_units_count*15, 0x3F0A);
-        avio_wb32(pb, mxf->edit_units_count);  // num of entries
-        avio_wb32(pb, 15);  // size of one entry
 
         for (i = 0; i < mxf->edit_units_count; i++) {
             int temporal_offset = 0;
 
+            // split the index table so that each segment fits 2 byte local 
set lengths
+            if (!(i % MXF_INDEX_MAX_ENTRIES)) {
+                int nb_entries = FFMIN(mxf->edit_units_count - i, 
MXF_INDEX_MAX_ENTRIES);
+                mxf_write_index_table_segment_header(s, 
mxf->last_indexed_edit_unit + i,
+                                                     nb_entries);
+                mxf_write_local_tag(s, 8 + nb_entries*MXF_INDEX_ENTRY_SIZE, 
0x3F0A);
+                avio_wb32(pb, nb_entries);           // num of entries
+                avio_wb32(pb, MXF_INDEX_ENTRY_SIZE); // size of one entry
+            }
+
             if (!(mxf->index_entries[i].flags & 0x33)) { // I-frame
                 sc->max_gop = FFMAX(sc->max_gop, i - mxf->last_key_index);
                 mxf->last_key_index = key_index;
                 key_index = i;
             }
 
-            if (temporal_reordering) {
+            if (sc->temporal_reordering) {
                 int pic_num_in_gop = i - key_index;
                 if (pic_num_in_gop != mxf->index_entries[i].temporal_ref) {
                     for (j = key_index; j < mxf->edit_units_count; j++) {
@@ -2186,8 +2207,6 @@ static int mxf_write_index_table_segment(AVFormatContext 
*s)
         mxf->edit_units_count = 0;
     }
 
-    mxf_update_klv_size(pb, pos);
-
     return 0;
 }
 
@@ -2210,20 +2229,20 @@ static int mxf_write_partition(AVFormatContext *s, int 
bodysid,
     MXFContext *mxf = s->priv_data;
     AVIOContext *pb = s->pb;
     int64_t header_byte_count_offset;
-    unsigned index_byte_count = 0;
+    uint64_t index_byte_count = 0;
     uint64_t partition_offset = avio_tell(pb);
     int err;
 
-    if (!mxf->edit_unit_byte_count && mxf->edit_units_count)
-        index_byte_count = 85 + 12+mxf_index_delta_count(s)*6 +
-            12+mxf->edit_units_count*15;
-    else if (mxf->edit_unit_byte_count && indexsid)
-        index_byte_count = 80;
+    if (!mxf->edit_unit_byte_count && mxf->edit_units_count) {
+        unsigned nb_segments = 1 + (mxf->edit_units_count - 1) / 
MXF_INDEX_MAX_ENTRIES;
+        // key and ber4 length, fixed sets, delta and index entry arrays per 
segment
+        index_byte_count = (uint64_t)nb_segments * (16 + 4 + 
mxf_index_header_size(s) + 12) +
+                           (uint64_t)mxf->edit_units_count * 
MXF_INDEX_ENTRY_SIZE;
+    } else if (mxf->edit_unit_byte_count && indexsid)
+        index_byte_count = 16 + 4 + 80;
 
-    if (index_byte_count) {
-        index_byte_count += 16 + 4; // add encoded ber4 length
+    if (index_byte_count)
         index_byte_count += klv_fill_size(index_byte_count);
-    }
 
     if (key && !memcmp(key, body_partition_key, 16)) {
         if ((err = av_reallocp_array(&mxf->body_partition_offset, 
mxf->body_partitions_count + 1,
-- 
2.54.0


From 6af75a4bbfb1f6f28f1424120c4770953767b02f Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <[email protected]>
Date: Fri, 13 Nov 2026 16:38:36 -0800
Subject: [PATCH 4/5] avformat/mxfenc: compute the CBE IndexByteCount

It was hardcoded and too small with many delta entries.

Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavformat/mxfenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 016e841845c..c4314b460e6 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2239,7 +2239,7 @@ static int mxf_write_partition(AVFormatContext *s, int 
bodysid,
         index_byte_count = (uint64_t)nb_segments * (16 + 4 + 
mxf_index_header_size(s) + 12) +
                            (uint64_t)mxf->edit_units_count * 
MXF_INDEX_ENTRY_SIZE;
     } else if (mxf->edit_unit_byte_count && indexsid)
-        index_byte_count = 16 + 4 + 80;
+        index_byte_count = 16 + 4 + mxf_index_header_size(s);
 
     if (index_byte_count)
         index_byte_count += klv_fill_size(index_byte_count);
-- 
2.54.0


From cb185a0bd2b435f96337140b916d6eb58e399adf Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <[email protected]>
Date: Fri, 13 Nov 2026 17:34:34 -0800
Subject: [PATCH 5/5] avformat/mxfenc: do not write index slices when the
 picture is the last element

There should be no slices then, ST 377-1 11.1.4.

Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavformat/mxfenc.c                    | 43 ++++++++++++++++---------
 tests/ref/fate/mxf-opatom-user-comments |  2 +-
 tests/ref/fate/time_base                |  2 +-
 tests/ref/lavf/mxf_ffv1                 |  4 +--
 4 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index c4314b460e6..89357f7147f 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -471,7 +471,6 @@ typedef struct MXFContext {
     MXFIndexEntry *index_entries;
     unsigned edit_units_count;
     uint64_t timestamp;   ///< timestamp, as 
year(16),month(8),day(8),hour(8),minutes(8),msec/4(8)
-    uint8_t slice_count;  ///< index slice count minus 1 (1 if no audio, 0 
otherwise)
     int last_indexed_edit_unit;
     uint64_t *body_partition_offset;
     unsigned body_partitions_count;
@@ -2011,9 +2010,26 @@ static unsigned klv_fill_size(uint64_t size)
         return pad & (KAG_SIZE-1);
 }
 
-#define MXF_INDEX_ENTRY_SIZE 15
+/**
+ * Number of slices minus 1. Elements following the VBE picture are in slice 1,
+ * there should be no slices if the picture is the last element, ST 377-1 
11.1.4.
+ */
+static int mxf_index_slice_count(AVFormatContext *s)
+{
+    MXFContext *mxf = s->priv_data;
+    return !mxf->edit_unit_byte_count && s->nb_streams > 1;
+}
+
+static int mxf_index_entry_size(AVFormatContext *s)
+{
+    return 11 + 4 * mxf_index_slice_count(s);
+}
+
 // largest IndexEntryArray fitting a 2 byte local set length
-#define MXF_INDEX_MAX_ENTRIES ((UINT16_MAX - 8) / MXF_INDEX_ENTRY_SIZE)
+static int mxf_index_max_entries(AVFormatContext *s)
+{
+    return (UINT16_MAX - 8) / mxf_index_entry_size(s);
+}
 
 static int mxf_index_delta_count(AVFormatContext *s)
 {
@@ -2048,7 +2064,7 @@ static void 
mxf_write_index_table_segment_header(AVFormatContext *s, int64_t sta
     int i;
 
     if (duration)
-        size += 12 + duration * MXF_INDEX_ENTRY_SIZE;
+        size += 12 + duration * mxf_index_entry_size(s);
     avio_write(pb, index_table_segment_key, 16);
     klv_encode_ber4_length(pb, size);
 
@@ -2083,7 +2099,7 @@ static void 
mxf_write_index_table_segment_header(AVFormatContext *s, int64_t sta
 
     // real slice count - 1
     mxf_write_local_tag(s, 1, 0x3F08);
-    avio_w8(pb, !mxf->edit_unit_byte_count); // only one slice for CBR
+    avio_w8(pb, mxf_index_slice_count(s));
 
     // delta entry array
     mxf_write_local_tag(s, 8 + mxf_index_delta_count(s)*6, 0x3F09);
@@ -2140,13 +2156,13 @@ static int 
mxf_write_index_table_segment(AVFormatContext *s)
             int temporal_offset = 0;
 
             // split the index table so that each segment fits 2 byte local 
set lengths
-            if (!(i % MXF_INDEX_MAX_ENTRIES)) {
-                int nb_entries = FFMIN(mxf->edit_units_count - i, 
MXF_INDEX_MAX_ENTRIES);
+            if (!(i % mxf_index_max_entries(s))) {
+                int nb_entries = FFMIN(mxf->edit_units_count - i, 
mxf_index_max_entries(s));
                 mxf_write_index_table_segment_header(s, 
mxf->last_indexed_edit_unit + i,
                                                      nb_entries);
-                mxf_write_local_tag(s, 8 + nb_entries*MXF_INDEX_ENTRY_SIZE, 
0x3F0A);
+                mxf_write_local_tag(s, 8 + nb_entries*mxf_index_entry_size(s), 
0x3F0A);
                 avio_wb32(pb, nb_entries);           // num of entries
-                avio_wb32(pb, MXF_INDEX_ENTRY_SIZE); // size of one entry
+                avio_wb32(pb, mxf_index_entry_size(s)); // size of one entry
             }
 
             if (!(mxf->index_entries[i].flags & 0x33)) { // I-frame
@@ -2196,10 +2212,8 @@ static int mxf_write_index_table_segment(AVFormatContext 
*s)
             avio_w8(pb, mxf->index_entries[i].flags);
             // stream offset
             avio_wb64(pb, mxf->index_entries[i].offset);
-            if (s->nb_streams > 1)
+            if (mxf_index_slice_count(s))
                 avio_wb32(pb, mxf->index_entries[i].slice_offset);
-            else
-                avio_wb32(pb, 0);
         }
 
         mxf->last_key_index = key_index - mxf->edit_units_count;
@@ -2234,10 +2248,10 @@ static int mxf_write_partition(AVFormatContext *s, int 
bodysid,
     int err;
 
     if (!mxf->edit_unit_byte_count && mxf->edit_units_count) {
-        unsigned nb_segments = 1 + (mxf->edit_units_count - 1) / 
MXF_INDEX_MAX_ENTRIES;
+        unsigned nb_segments = 1 + (mxf->edit_units_count - 1) / 
mxf_index_max_entries(s);
         // key and ber4 length, fixed sets, delta and index entry arrays per 
segment
         index_byte_count = (uint64_t)nb_segments * (16 + 4 + 
mxf_index_header_size(s) + 12) +
-                           (uint64_t)mxf->edit_units_count * 
MXF_INDEX_ENTRY_SIZE;
+                           (uint64_t)mxf->edit_units_count * 
mxf_index_entry_size(s);
     } else if (mxf->edit_unit_byte_count && indexsid)
         index_byte_count = 16 + 4 + mxf_index_header_size(s);
 
@@ -3115,7 +3129,6 @@ static int mxf_init(AVFormatContext *s)
                 mxf->edit_unit_byte_count = 
(av_get_bits_per_sample(st->codecpar->codec_id) * 
st->codecpar->ch_layout.nb_channels) >> 3;
                 sc->index = INDEX_WAV;
             } else {
-                mxf->slice_count = 1;
                 sc->frame_size = st->codecpar->ch_layout.nb_channels *
                                  av_rescale_rnd(st->codecpar->sample_rate, 
mxf->time_base.num, mxf->time_base.den, AV_ROUND_UP) *
                                  
av_get_bits_per_sample(st->codecpar->codec_id) / 8;
diff --git a/tests/ref/fate/mxf-opatom-user-comments 
b/tests/ref/fate/mxf-opatom-user-comments
index 66afabf2e24..b60aae9afd9 100644
--- a/tests/ref/fate/mxf-opatom-user-comments
+++ b/tests/ref/fate/mxf-opatom-user-comments
@@ -1 +1 @@
-b3191be3ec3f84e5d756f86a51cc2b20
+8df1c62368ab861010a0e378c12c154c
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index ae96232e60c..04129b300f4 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-69ffc45e19ab070bc3e964d7b718fe53
+479107911a1a90d03422cf5a7660a23d
diff --git a/tests/ref/lavf/mxf_ffv1 b/tests/ref/lavf/mxf_ffv1
index 4ae93b2e892..20bf8115856 100644
--- a/tests/ref/lavf/mxf_ffv1
+++ b/tests/ref/lavf/mxf_ffv1
@@ -1,3 +1,3 @@
-67638015788bb7dfcc1c16183967b513 *tests/data/lavf/lavf.mxf_ffv1
-5587001 tests/data/lavf/lavf.mxf_ffv1
+bb73cbf1750bebd278633e4ac3752a48 *tests/data/lavf/lavf.mxf_ffv1
+5586489 tests/data/lavf/lavf.mxf_ffv1
 tests/data/lavf/lavf.mxf_ffv1 CRC=0x02354cdc
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to