This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 8dfbb54e8a4defe162bfb893f510354df881542f Author: Baptiste Coudurier <[email protected]> AuthorDate: Fri Nov 13 16:22:33 2026 -0800 Commit: Baptiste Coudurier <[email protected]> CommitDate: Mon Nov 23 06:01:27 2026 +0000 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 6ee68a2f46..887d5bd825 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -2056,6 +2056,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) @@ -2126,13 +2132,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]; @@ -2145,7 +2153,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; @@ -2252,7 +2261,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 98fa698a86..490a7502d5 100644 --- a/tests/ref/fate/mxf-opatom-user-comments +++ b/tests/ref/fate/mxf-opatom-user-comments @@ -1 +1 @@ -e1de3ef7984c753c3829ca6b717bfcd3 +6c3ed91e9187cb938c3b3815afcbeed8 diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom index cde56adc18..5e5e3c00cc 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -f65b5312d2233a5963c0c59a8bb2c59f *tests/data/lavf/lavf.mxf_opatom +0993d4aa0bf1a96df8b91749db2324fd *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 7272159799..51e968ba0c 100644 --- a/tests/ref/lavf/mxf_opatom_audio +++ b/tests/ref/lavf/mxf_opatom_audio @@ -1,3 +1,3 @@ -2c042a4c213356439b30c21254482496 *tests/data/lavf/lavf.mxf_opatom_audio +05c4160d59343f02b91e078b74b7c14d *tests/data/lavf/lavf.mxf_opatom_audio 102969 tests/data/lavf/lavf.mxf_opatom_audio tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
