Commit 47dd2171bd for ffmpeg
commit 47dd2171bdabb656ac51e10a5898e5ecab6f8428
Author: Romain Beauxis <romain.beauxis@gmail.com>
Date: Thu Oct 29 09:36:49 2026 -0500
fate/ogg-vorbis: add a test for misplaced chained stream headers
Splice pages of moog_small.ogg into a stream with comment and setup
headers without identification header, then an identification header
followed by audio.
The reference records the current output: the metadata of misplaced
comment headers is applied, and headers from different places are
packed into new extradata.
diff --git a/tests/fate/ogg-vorbis.mak b/tests/fate/ogg-vorbis.mak
index d009f4e818..34086a61cc 100644
--- a/tests/fate/ogg-vorbis.mak
+++ b/tests/fate/ogg-vorbis.mak
@@ -16,6 +16,24 @@ fate-ogg-vorbis-chained-large-comment: CMD = \
-c copy -t 0.5 -fflags +bitexact -serial_offset 1 -f ogg -; } | \
framecrc -i - -c copy
+# Splice pages of a single-chain sample: comment and setup headers without
+# identification header, then an identification header followed by audio,
+# then the complete sample again to check recovery.
+# The byte ranges are page boundaries of the sample.
+MOOG_SMALL_PAGES = ffmpeg -f data -i $(TARGET_SAMPLES)/vorbis/moog_small.ogg -map 0 -c copy -f data - | \
+ dd bs=1 skip=$(1) count=$$(($(2) - $(1))) 2>/dev/null
+FATE_OGG_VORBIS_FFMPEG_FFPROBE-$(call DEMDEC, OGG DATA, VORBIS, DATA_MUXER PIPE_PROTOCOL) += fate-ogg-vorbis-chained-misplaced-headers
+fate-ogg-vorbis-chained-misplaced-headers: CMD = \
+ { $(call MOOG_SMALL_PAGES,0,33991) && \
+ $(call MOOG_SMALL_PAGES,58,12762) && \
+ $(call MOOG_SMALL_PAGES,0,58) && \
+ $(call MOOG_SMALL_PAGES,12762,33991) && \
+ $(call MOOG_SMALL_PAGES,58,12762) && \
+ $(call MOOG_SMALL_PAGES,12762,33991) && \
+ $(call MOOG_SMALL_PAGES,0,12762) && \
+ $(call MOOG_SMALL_PAGES,12762,33991); } | \
+ probe -show_entries packet=pts:packet_tags:packet_side_data=side_data_type -of compact pipe:
+
FATE_OGG_VORBIS_PROBE-$(call DEMDEC, OGG, VORBIS) += fate-ogg-vorbis-initial-padding-chained
fate-ogg-vorbis-initial-padding-chained: CMD = ffprobe_demux -of default -show_entries stream=codec_name,initial_padding $(TARGET_SAMPLES)/ogg-vorbis/chained-meta.ogg
@@ -52,4 +70,6 @@ FATE_SAMPLES_FFPROBE += $(FATE_OGG_VORBIS_PROBE-yes)
FATE_FFMPEG_FFPROBE += $(FATE_OGG_VORBIS_ENCODE_PROBE-yes)
-fate-ogg-vorbis: $(FATE_OGG_VORBIS-yes) $(FATE_OGG_COPY_VORBIS-yes) $(FATE_OGG_VORBIS_PROBE-yes) $(FATE_OGG_VORBIS_ENCODE_PROBE-yes)
+FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_OGG_VORBIS_FFMPEG_FFPROBE-yes)
+
+fate-ogg-vorbis: $(FATE_OGG_VORBIS-yes) $(FATE_OGG_COPY_VORBIS-yes) $(FATE_OGG_VORBIS_PROBE-yes) $(FATE_OGG_VORBIS_ENCODE_PROBE-yes) $(FATE_OGG_VORBIS_FFMPEG_FFPROBE-yes)
diff --git a/tests/ref/fate/ogg-vorbis-chained-misplaced-headers b/tests/ref/fate/ogg-vorbis-chained-misplaced-headers
new file mode 100644
index 0000000000..d4e1e0c085
--- /dev/null
+++ b/tests/ref/fate/ogg-vorbis-chained-misplaced-headers
@@ -0,0 +1,292 @@
+packet|pts=-128|tag:title=Ziggy Stardust|tag:artist=The Moog Cookbook|tag:album=The Moog Cookbook Plays The Classic Rock Hits|tag:track=4|side_datum/strings_metadata:side_data_type=Strings Metadata
+packet|pts=0
+packet|pts=576
+packet|pts=1600
+packet|pts=2624
+packet|pts=3648
+packet|pts=4224
+packet|pts=4352
+packet|pts=4480
+packet|pts=5056
+packet|pts=6080
+packet|pts=7104
+packet|pts=8128
+packet|pts=9152
+packet|pts=10176
+packet|pts=11200
+packet|pts=12224
+packet|pts=13248
+packet|pts=14272
+packet|pts=15296
+packet|pts=16320
+packet|pts=17344
+packet|pts=18368
+packet|pts=19392
+packet|pts=20416
+packet|pts=21440
+packet|pts=22464
+packet|pts=23488
+packet|pts=24512
+packet|pts=25536
+packet|pts=26560
+packet|pts=27584
+packet|pts=28608
+packet|pts=29632
+packet|pts=30656
+packet|pts=31680
+packet|pts=32704
+packet|pts=33728
+packet|pts=34752
+packet|pts=35776
+packet|pts=36800
+packet|pts=37824
+packet|pts=38848
+packet|pts=39872
+packet|pts=40896
+packet|pts=41920
+packet|pts=42944
+packet|pts=43968
+packet|pts=44992
+packet|pts=46016
+packet|pts=47040
+packet|pts=48064
+packet|pts=49088
+packet|pts=50112
+packet|pts=51136
+packet|pts=52160
+packet|pts=53184
+packet|pts=54208
+packet|pts=55232
+packet|pts=56256
+packet|pts=57280
+packet|pts=58304
+packet|pts=59328
+packet|pts=60352
+packet|pts=61376
+packet|pts=62400
+packet|pts=63424
+packet|pts=64448
+packet|pts=65472
+packet|pts=66496
+packet|pts=67520
+packet|pts=68544
+packet|pts=69568
+packet|pts=70016|tag:title=Ziggy Stardust|tag:artist=The Moog Cookbook|tag:album=The Moog Cookbook Plays The Classic Rock Hits|tag:track=4|side_datum/strings_metadata:side_data_type=Strings Metadata|side_datum/new_extradata:side_data_type=New Extradata
+packet|pts=70144
+packet|pts=70720
+packet|pts=71744
+packet|pts=72768
+packet|pts=73792
+packet|pts=74368
+packet|pts=74496
+packet|pts=74624
+packet|pts=75200
+packet|pts=76224
+packet|pts=77248
+packet|pts=78272
+packet|pts=79296
+packet|pts=80320
+packet|pts=81344
+packet|pts=82368
+packet|pts=83392
+packet|pts=84416
+packet|pts=85440
+packet|pts=16320
+packet|pts=17344
+packet|pts=18368
+packet|pts=19392
+packet|pts=20416
+packet|pts=21440
+packet|pts=22464
+packet|pts=23488
+packet|pts=24512
+packet|pts=25536
+packet|pts=26560
+packet|pts=27584
+packet|pts=28608
+packet|pts=29632
+packet|pts=30656
+packet|pts=31680
+packet|pts=32704
+packet|pts=33728
+packet|pts=34752
+packet|pts=35776
+packet|pts=36800
+packet|pts=37824
+packet|pts=38848
+packet|pts=39872
+packet|pts=40896
+packet|pts=41920
+packet|pts=42944
+packet|pts=43968
+packet|pts=44992
+packet|pts=46016
+packet|pts=47040
+packet|pts=48064
+packet|pts=49088
+packet|pts=50112
+packet|pts=51136
+packet|pts=52160
+packet|pts=53184
+packet|pts=54208
+packet|pts=55232
+packet|pts=56256
+packet|pts=57280
+packet|pts=58304
+packet|pts=59328
+packet|pts=60352
+packet|pts=61376
+packet|pts=62400
+packet|pts=63424
+packet|pts=64448
+packet|pts=65472
+packet|pts=66496
+packet|pts=67520
+packet|pts=68544
+packet|pts=69568
+packet|pts=70144|tag:title=Ziggy Stardust|tag:artist=The Moog Cookbook|tag:album=The Moog Cookbook Plays The Classic Rock Hits|tag:track=4|side_datum/strings_metadata:side_data_type=Strings Metadata
+packet|pts=70272
+packet|pts=70848
+packet|pts=71872
+packet|pts=72896
+packet|pts=73920
+packet|pts=74496
+packet|pts=74624
+packet|pts=74752
+packet|pts=75328
+packet|pts=76352
+packet|pts=77376
+packet|pts=78400
+packet|pts=79424
+packet|pts=80448
+packet|pts=81472
+packet|pts=82496
+packet|pts=83520
+packet|pts=84544
+packet|pts=85568
+packet|pts=16320
+packet|pts=17344
+packet|pts=18368
+packet|pts=19392
+packet|pts=20416
+packet|pts=21440
+packet|pts=22464
+packet|pts=23488
+packet|pts=24512
+packet|pts=25536
+packet|pts=26560
+packet|pts=27584
+packet|pts=28608
+packet|pts=29632
+packet|pts=30656
+packet|pts=31680
+packet|pts=32704
+packet|pts=33728
+packet|pts=34752
+packet|pts=35776
+packet|pts=36800
+packet|pts=37824
+packet|pts=38848
+packet|pts=39872
+packet|pts=40896
+packet|pts=41920
+packet|pts=42944
+packet|pts=43968
+packet|pts=44992
+packet|pts=46016
+packet|pts=47040
+packet|pts=48064
+packet|pts=49088
+packet|pts=50112
+packet|pts=51136
+packet|pts=52160
+packet|pts=53184
+packet|pts=54208
+packet|pts=55232
+packet|pts=56256
+packet|pts=57280
+packet|pts=58304
+packet|pts=59328
+packet|pts=60352
+packet|pts=61376
+packet|pts=62400
+packet|pts=63424
+packet|pts=64448
+packet|pts=65472
+packet|pts=66496
+packet|pts=67520
+packet|pts=68544
+packet|pts=69568
+packet|pts=70016|tag:title=Ziggy Stardust|tag:artist=The Moog Cookbook|tag:album=The Moog Cookbook Plays The Classic Rock Hits|tag:track=4|side_datum/strings_metadata:side_data_type=Strings Metadata|side_datum/new_extradata:side_data_type=New Extradata
+packet|pts=70144
+packet|pts=70720
+packet|pts=71744
+packet|pts=72768
+packet|pts=73792
+packet|pts=74368
+packet|pts=74496
+packet|pts=74624
+packet|pts=75200
+packet|pts=76224
+packet|pts=77248
+packet|pts=78272
+packet|pts=79296
+packet|pts=80320
+packet|pts=81344
+packet|pts=82368
+packet|pts=83392
+packet|pts=84416
+packet|pts=85440
+packet|pts=16320
+packet|pts=17344
+packet|pts=18368
+packet|pts=19392
+packet|pts=20416
+packet|pts=21440
+packet|pts=22464
+packet|pts=23488
+packet|pts=24512
+packet|pts=25536
+packet|pts=26560
+packet|pts=27584
+packet|pts=28608
+packet|pts=29632
+packet|pts=30656
+packet|pts=31680
+packet|pts=32704
+packet|pts=33728
+packet|pts=34752
+packet|pts=35776
+packet|pts=36800
+packet|pts=37824
+packet|pts=38848
+packet|pts=39872
+packet|pts=40896
+packet|pts=41920
+packet|pts=42944
+packet|pts=43968
+packet|pts=44992
+packet|pts=46016
+packet|pts=47040
+packet|pts=48064
+packet|pts=49088
+packet|pts=50112
+packet|pts=51136
+packet|pts=52160
+packet|pts=53184
+packet|pts=54208
+packet|pts=55232
+packet|pts=56256
+packet|pts=57280
+packet|pts=58304
+packet|pts=59328
+packet|pts=60352
+packet|pts=61376
+packet|pts=62400
+packet|pts=63424
+packet|pts=64448
+packet|pts=65472
+packet|pts=66496
+packet|pts=67520
+packet|pts=68544
+packet|pts=69568