This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new d790378fdb avformat/mxfdec: restrict AVC-Intra extradata to intra-only
streams
d790378fdb is described below
commit d790378fdbde6ac051e816a8ef8eb9671ca9a591
Author: Michael Niedermayer <[email protected]>
AuthorDate: Sun Sep 6 22:11:52 2026 +0000
Commit: michaelni <[email protected]>
CommitDate: Thu Sep 17 03:09:07 2026 +0000
avformat/mxfdec: restrict AVC-Intra extradata to intra-only streams
Generating AVC-Intra parameter sets for ordinary AVC streams leaves
codecpar with extradata unrelated to the in-band SPS/PPS. Seeking to a
non-IDR I picture without parameter sets then initializes the decoder
with the wrong headers, even when the stream has constant parameter sets.
Use the existing intra-only classification to restrict this fallback,
allowing stream probing to extract the actual headers for long GOP AVC.
Add a probe test using the existing XAVC sample to check the extradata
size and hash. It fails with the generated AVC-Intra headers.
Fixes: #22467
Assisted-by: Fairy
---
libavformat/mxfdec.c | 2 +-
tests/fate/mxf.mak | 5 +++++
tests/ref/fate/mxf-probe-h264-extradata | 4 ++++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 4ba4af1fa7..280a20aad3 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3129,7 +3129,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
if (!ff_alloc_extradata(st->codecpar, descriptor->extradata_size))
{
memcpy(st->codecpar->extradata, descriptor->extradata,
descriptor->extradata_size);
}
- } else if (st->codecpar->codec_id == AV_CODEC_ID_H264) {
+ } else if (st->codecpar->codec_id == AV_CODEC_ID_H264 &&
source_track->intra_only) {
int coded_width =
mxf_get_codec_ul(mxf_intra_only_picture_coded_width,
&descriptor->essence_codec_ul)->id;
if (coded_width)
diff --git a/tests/fate/mxf.mak b/tests/fate/mxf.mak
index ba09d136ce..10c310dd34 100644
--- a/tests/fate/mxf.mak
+++ b/tests/fate/mxf.mak
@@ -23,6 +23,11 @@ FATE_MXF_PROBE-$(call DEMDEC, MXF, MPEG2VIDEO PCM_S16LE,
MPEGVIDEO_PARSER EXTRAC
fate-mxf-probe-d10: SRC = $(TARGET_SAMPLES)/mxf/Sony-00001.mxf
fate-mxf-probe-d10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
+# Long GOP AVC must retain its in-band parameter sets, not AVC-Intra defaults.
+FATE_MXF_PROBE-$(call DEMDEC, MXF, H264, H264_PARSER EXTRACT_EXTRADATA_BSF) +=
fate-mxf-probe-h264-extradata
+fate-mxf-probe-h264-extradata: SRC =
$(TARGET_SAMPLES)/h264/SonyXAVC_LongGOP_green_pixelation_early_Frames.MXF
+fate-mxf-probe-h264-extradata: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -bitexact
-v 0 -select_streams v -show_entries
stream=extradata,extradata_size,extradata_hash -show_data_hash md5 -i "$(SRC)"
+
FATE_MXF_PROBE-$(call DEMDEC, MXF, DNXHD) += fate-mxf-probe-dnxhd
fate-mxf-probe-dnxhd: SRC = $(TARGET_SAMPLES)/mxf/multiple_components.mxf
fate-mxf-probe-dnxhd: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
diff --git a/tests/ref/fate/mxf-probe-h264-extradata
b/tests/ref/fate/mxf-probe-h264-extradata
new file mode 100644
index 0000000000..482bca0ce5
--- /dev/null
+++ b/tests/ref/fate/mxf-probe-h264-extradata
@@ -0,0 +1,4 @@
+[STREAM]
+extradata_size=254
+extradata_hash=MD5:0a4fe18be973294d0433253d1e8548bc
+[/STREAM]
--
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]