PR #25557 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25557
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25557.patch

Some fixes after looking at #25121, which was already merged, I didn't see it 
before. Mostly removed useless test app, and fixes surrounding code EXT-X-START 
handling. 


From 11822e10aa72c2c68b42a5d4447aa284f011147c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 04:06:00 +0100
Subject: [PATCH 1/4] tests/fate/demux: add HLS EXT-X-START tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

hls-start-master.m3u8 has an EXT-X-START before its EXT-X-MEDIA and
EXT-X-STREAM-INF tags. Its variant hls-start-media.m3u8 has one of its
own and its audio rendition none. Both are live playlists of four
0.144 s segments. hls-start-variant.m3u8 is the same Master Playlist
without EXT-X-START. hls-start-endlist.m3u8 has an EXT-X-ENDLIST
between its EXT-X-START and its first segment.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/demux.mak                   | 25 +++++++++++++++++++++++++
 tests/ref/fate/hls-start-endlist-demux | 10 ++++++++++
 tests/ref/fate/hls-start-master-demux  | 19 +++++++++++++++++++
 tests/ref/fate/hls-start-media-demux   |  4 ++++
 tests/ref/fate/hls-start-variant-demux | 11 +++++++++++
 5 files changed, 69 insertions(+)
 create mode 100644 tests/ref/fate/hls-start-endlist-demux
 create mode 100644 tests/ref/fate/hls-start-master-demux
 create mode 100644 tests/ref/fate/hls-start-media-demux
 create mode 100644 tests/ref/fate/hls-start-variant-demux

diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index d4ac666f810..e178a8883a8 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -233,6 +233,31 @@ fate-hls-shared-renditions-demux: 
tests/data/hls-shared-renditions.m3u8
 fate-hls-shared-renditions-demux: CLEANFILES = 
tests/data/hls-shared-renditions*.m3u8 tests/data/hls-shared-renditions-*.ts 
tests/data/hls-shared-renditions-*.vtt
 fate-hls-shared-renditions-demux: CMD = ffprobe_demux 
$(TARGET_PATH)/tests/data/hls-shared-renditions.m3u8 -show_programs
 
+tests/data/hls-start-master.m3u8: TAG = GEN
+tests/data/hls-start-master.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
+        -f lavfi -i "aevalsrc=0:s=16000:d=0.576" -c:a mp2fixed -flags 
+bitexact -muxdelay 0 -muxpreload 0 \
+        -f hls -hls_time 0.144 -hls_list_size 0 -hls_flags omit_endlist \
+        -hls_segment_filename $(TARGET_PATH)/tests/data/hls-start-%d.ts \
+        $(TARGET_PATH)/tests/data/hls-start-rendition.m3u8 2>/dev/null
+       $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=0.5\n#EXT-X-TARGETDURATION:0\n#EXTINF:0.144,\nhls-start-0.ts\n#EXTINF:0.144,\nhls-start-1.ts\n#EXTINF:0.144,\nhls-start-2.ts\n#EXTINF:0.144,\nhls-start-3.ts\n'
 > tests/data/hls-start-media.m3u8
+       $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=0.5\n#EXT-X-ENDLIST\n#EXT-X-TARGETDURATION:0\n#EXTINF:0.144,\nhls-start-0.ts\n#EXTINF:0.144,\nhls-start-1.ts\n#EXTINF:0.144,\nhls-start-2.ts\n#EXTINF:0.144,\nhls-start-3.ts\n'
 > tests/data/hls-start-endlist.m3u8
+       $(Q)printf 
'#EXTM3U\n#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="a",NAME="a",URI="hls-start-rendition.m3u8"\n#EXT-X-STREAM-INF:BANDWIDTH=64000,AUDIO="a"\nhls-start-media.m3u8\n'
 > tests/data/hls-start-variant.m3u8
+       $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=0.1\n#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="a",NAME="a",URI="hls-start-rendition.m3u8"\n#EXT-X-STREAM-INF:BANDWIDTH=64000,AUDIO="a"\nhls-start-media.m3u8\n'
 > $@
+
+FATE_HLS_START = fate-hls-start-master-demux  \
+                 fate-hls-start-variant-demux \
+                 fate-hls-start-media-demux   \
+                 fate-hls-start-endlist-demux
+
+FATE_HLS_START-$(call FILTERDEMDECENCMUX, AEVALSRC ARESAMPLE, HLS MPEGTS, MP2 
MP3FLOAT PCM_F64LE, MP2FIXED, HLS MPEGTS, LAVFI_INDEV MPEGAUDIO_PARSER) += 
$(FATE_HLS_START)
+FATE_FFMPEG_FFPROBE += $(FATE_HLS_START-yes)
+$(FATE_HLS_START): tests/data/hls-start-master.m3u8
+fate-hls-start-master-demux: CMD = ffprobe_demux 
$(TARGET_PATH)/tests/data/hls-start-master.m3u8 -prefer_x_start 1 -max_reload 1
+fate-hls-start-variant-demux: CMD = ffprobe_demux 
$(TARGET_PATH)/tests/data/hls-start-variant.m3u8 -prefer_x_start 1 -max_reload 1
+fate-hls-start-media-demux: CMD = ffprobe_demux 
$(TARGET_PATH)/tests/data/hls-start-media.m3u8 -prefer_x_start 1 -max_reload 1
+fate-hls-start-endlist-demux: CMD = ffprobe_demux 
$(TARGET_PATH)/tests/data/hls-start-endlist.m3u8 -prefer_x_start 1 -max_reload 1
+
 FATE_SAMPLES_DEMUX-$(call PARSERDEM, JPEGXS, IMAGE_JPEGXS_PIPE, 
CONCAT_PROTOCOL) += fate-jxs-concat-demux
 fate-jxs-concat-demux: CMD = framecrc "-i 
concat:$(TARGET_SAMPLES)/jxs/lena.jxs|$(TARGET_SAMPLES)/jxs/lena.jxs -c:v copy"
 
diff --git a/tests/ref/fate/hls-start-endlist-demux 
b/tests/ref/fate/hls-start-endlist-demux
new file mode 100644
index 00000000000..2c85218a05b
--- /dev/null
+++ b/tests/ref/fate/hls-start-endlist-demux
@@ -0,0 +1,10 @@
+packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=N/A|duration_time=N/A|size=1440|pos=564|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=6480|pts_time=0.072000|dts=6480|dts_time=0.072000|duration=6480|duration_time=0.072000|size=1440|pos=2068|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=12960|pts_time=0.144000|dts=12960|dts_time=0.144000|duration=6480|duration_time=0.072000|size=1440|pos=4136|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=19440|pts_time=0.216000|dts=19440|dts_time=0.216000|duration=6480|duration_time=0.072000|size=1440|pos=5640|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=25920|pts_time=0.288000|dts=25920|dts_time=0.288000|duration=6480|duration_time=0.072000|size=1440|pos=7708|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=32400|pts_time=0.360000|dts=32400|dts_time=0.360000|duration=6480|duration_time=0.072000|size=1440|pos=9212|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=38880|pts_time=0.432000|dts=38880|dts_time=0.432000|duration=6480|duration_time=0.072000|size=1440|pos=11280|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=45360|pts_time=0.504000|dts=45360|dts_time=0.504000|duration=6480|duration_time=0.072000|size=1440|pos=12784|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+stream|index=0|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=unknown|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x0|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=0
+format|filename=hls-start-endlist.m3u8|nb_streams=1|nb_programs=1|nb_stream_groups=0|format_name=hls|start_time=0.000000|duration=0.576000|size=196|bit_rate=2722|probe_score=100
diff --git a/tests/ref/fate/hls-start-master-demux 
b/tests/ref/fate/hls-start-master-demux
new file mode 100644
index 00000000000..c358cb243a9
--- /dev/null
+++ b/tests/ref/fate/hls-start-master-demux
@@ -0,0 +1,19 @@
+packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=3240|duration_time=0.036000|size=1440|pos=564|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=N/A|duration_time=N/A|size=1440|pos=564|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=6480|pts_time=0.072000|dts=6480|dts_time=0.072000|duration=6480|duration_time=0.072000|size=1440|pos=2068|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=6480|pts_time=0.072000|dts=6480|dts_time=0.072000|duration=6480|duration_time=0.072000|size=1440|pos=2068|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=12960|pts_time=0.144000|dts=12960|dts_time=0.144000|duration=6480|duration_time=0.072000|size=1440|pos=4136|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=12960|pts_time=0.144000|dts=12960|dts_time=0.144000|duration=6480|duration_time=0.072000|size=1440|pos=4136|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=19440|pts_time=0.216000|dts=19440|dts_time=0.216000|duration=6480|duration_time=0.072000|size=1440|pos=5640|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=19440|pts_time=0.216000|dts=19440|dts_time=0.216000|duration=6480|duration_time=0.072000|size=1440|pos=5640|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=25920|pts_time=0.288000|dts=25920|dts_time=0.288000|duration=6480|duration_time=0.072000|size=1440|pos=7708|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=25920|pts_time=0.288000|dts=25920|dts_time=0.288000|duration=6480|duration_time=0.072000|size=1440|pos=7708|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=32400|pts_time=0.360000|dts=32400|dts_time=0.360000|duration=6480|duration_time=0.072000|size=1440|pos=9212|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=32400|pts_time=0.360000|dts=32400|dts_time=0.360000|duration=6480|duration_time=0.072000|size=1440|pos=9212|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=38880|pts_time=0.432000|dts=38880|dts_time=0.432000|duration=6480|duration_time=0.072000|size=1440|pos=11280|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=38880|pts_time=0.432000|dts=38880|dts_time=0.432000|duration=6480|duration_time=0.072000|size=1440|pos=11280|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=45360|pts_time=0.504000|dts=45360|dts_time=0.504000|duration=6480|duration_time=0.072000|size=1440|pos=12784|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=45360|pts_time=0.504000|dts=45360|dts_time=0.504000|duration=6480|duration_time=0.072000|size=1440|pos=12784|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+stream|index=0|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=fltp|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x0|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=64000|tag:comment=a
+stream|index=1|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=unknown|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x1|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=64000
+format|filename=hls-start-master.m3u8|nb_streams=2|nb_programs=1|nb_stream_groups=0|format_name=hls|start_time=0.000000|duration=N/A|size=179|bit_rate=320000|probe_score=100
diff --git a/tests/ref/fate/hls-start-media-demux 
b/tests/ref/fate/hls-start-media-demux
new file mode 100644
index 00000000000..62b133b2e84
--- /dev/null
+++ b/tests/ref/fate/hls-start-media-demux
@@ -0,0 +1,4 @@
+packet|codec_type=audio|stream_index=0|pts=38880|pts_time=0.432000|dts=38880|dts_time=0.432000|duration=N/A|duration_time=N/A|size=1440|pos=564|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=45360|pts_time=0.504000|dts=45360|dts_time=0.504000|duration=6480|duration_time=0.072000|size=1440|pos=2068|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+stream|index=0|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=unknown|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x0|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=2|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=0
+format|filename=hls-start-media.m3u8|nb_streams=1|nb_programs=1|nb_stream_groups=0|format_name=hls|start_time=0.000000|duration=N/A|size=181|bit_rate=160000|probe_score=100
diff --git a/tests/ref/fate/hls-start-variant-demux 
b/tests/ref/fate/hls-start-variant-demux
new file mode 100644
index 00000000000..48fa2785d30
--- /dev/null
+++ b/tests/ref/fate/hls-start-variant-demux
@@ -0,0 +1,11 @@
+packet|codec_type=audio|stream_index=0|pts=12960|pts_time=0.144000|dts=12960|dts_time=0.144000|duration=3240|duration_time=0.036000|size=1440|pos=564|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=19440|pts_time=0.216000|dts=19440|dts_time=0.216000|duration=6480|duration_time=0.072000|size=1440|pos=2068|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=25920|pts_time=0.288000|dts=25920|dts_time=0.288000|duration=6480|duration_time=0.072000|size=1440|pos=4136|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=32400|pts_time=0.360000|dts=32400|dts_time=0.360000|duration=6480|duration_time=0.072000|size=1440|pos=5640|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=38880|pts_time=0.432000|dts=38880|dts_time=0.432000|duration=6480|duration_time=0.072000|size=1440|pos=7708|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=38880|pts_time=0.432000|dts=38880|dts_time=0.432000|duration=N/A|duration_time=N/A|size=1440|pos=564|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=0|pts=45360|pts_time=0.504000|dts=45360|dts_time=0.504000|duration=6480|duration_time=0.072000|size=1440|pos=9212|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+packet|codec_type=audio|stream_index=1|pts=45360|pts_time=0.504000|dts=45360|dts_time=0.504000|duration=6480|duration_time=0.072000|size=1440|pos=2068|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
+stream|index=0|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=s16p|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x0|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=6|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=64000|tag:comment=a
+stream|index=1|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=unknown|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x1|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=2|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=64000
+format|filename=hls-start-variant.m3u8|nb_streams=2|nb_programs=1|nb_stream_groups=0|format_name=hls|start_time=0.000000|duration=N/A|size=150|bit_rate=320000|probe_score=100
-- 
2.54.0


From 189ee1a20972f16b3e28be83680240257fb4afbf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 04:06:53 +0100
Subject: [PATCH 2/4] libavformat/tests: remove the hls test program
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The hls-start demux tests cover the cases of the hls-parse tests
through the demuxer. There is no need for hls.c API test code.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavformat/Makefile                          |   1 -
 libavformat/tests/.gitignore                  |   1 -
 libavformat/tests/hls.c                       | 100 ------------------
 tests/fate/libavformat.mak                    |  43 --------
 tests/ref/fate/hls-parse-master-media-start   |   3 -
 tests/ref/fate/hls-parse-master-start         |   3 -
 tests/ref/fate/hls-parse-master-start-media   |   3 -
 .../ref/fate/hls-parse-master-start-override  |   3 -
 tests/ref/fate/hls-parse-media-start          |   2 -
 tests/ref/fate/hls-parse-media-start-endlist  |   2 -
 10 files changed, 161 deletions(-)
 delete mode 100644 libavformat/tests/hls.c
 delete mode 100644 tests/ref/fate/hls-parse-master-media-start
 delete mode 100644 tests/ref/fate/hls-parse-master-start
 delete mode 100644 tests/ref/fate/hls-parse-master-start-media
 delete mode 100644 tests/ref/fate/hls-parse-master-start-override
 delete mode 100644 tests/ref/fate/hls-parse-media-start
 delete mode 100644 tests/ref/fate/hls-parse-media-start-endlist

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 92c09714fe7..ae8baaa12ff 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -798,7 +798,6 @@ TESTPROGS-$(CONFIG_RTPDEC)               += rtpdec
 FIFO-MUXER-TESTPROGS-$(CONFIG_NETWORK)   += fifo_muxer
 TESTPROGS-$(CONFIG_FIFO_MUXER)           += $(FIFO-MUXER-TESTPROGS-yes)
 TESTPROGS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh
-TESTPROGS-$(CONFIG_HLS_DEMUXER)          += hls
 TESTPROGS-$(CONFIG_HTTP_PROTOCOL)        += http
 TESTPROGS-$(CONFIG_NETWORK)              += noproxy
 TESTPROGS-$(CONFIG_SRTP)                 += srtp
diff --git a/libavformat/tests/.gitignore b/libavformat/tests/.gitignore
index f3640a487cc..dddaeea25f9 100644
--- a/libavformat/tests/.gitignore
+++ b/libavformat/tests/.gitignore
@@ -14,4 +14,3 @@
 /seek_utils
 /http
 /ogg_pages
-/hls
diff --git a/libavformat/tests/hls.c b/libavformat/tests/hls.c
deleted file mode 100644
index 267e66650eb..00000000000
--- a/libavformat/tests/hls.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavformat/hls.c"
-
-static void print_playlists(const HLSContext *c, int parse_ret)
-{
-    if (parse_ret < 0) {
-        printf("error: %s\n", av_err2str(parse_ret));
-        return;
-    }
-    printf("%d variant(s), %d playlist(s)\n", c->n_variants, c->n_playlists);
-    for (int i = 0; i < c->n_playlists; i++) {
-        const struct playlist *pls = c->playlists[i];
-        printf("%s: %s, ", av_basename(pls->url), pls->finished ? "finished" : 
"live");
-        if (pls->time_offset_flag)
-            printf("start offset %"PRId64"\n", pls->start_time_offset);
-        else
-            printf("no start offset\n");
-    }
-}
-
-/**
- * Parse a playlist, then optionally a Media Playlist into the first
- * playlist it declared, as hls_read_header() does, and print the parsed
- * playlists with their finished state and EXT-X-START offset.
- * Parsing errors are part of the output; only I/O and allocation errors
- * make the program fail.
- */
-int main(int argc, char **argv)
-{
-    AVIOContext *top_level = NULL, *first_media = NULL;
-    AVFormatContext *s = NULL;
-    HLSContext *c;
-    int ret, parse_ret;
-
-    if (argc < 2 || argc > 3) {
-        fprintf(stderr, "Usage: %s <playlist> [<media playlist>]\n", argv[0]);
-        return 1;
-    }
-
-    av_log_set_level(AV_LOG_QUIET);
-
-    ret = avio_open(&top_level, argv[1], AVIO_FLAG_READ);
-    if (ret < 0)
-        goto end;
-    if (argc > 2) {
-        ret = avio_open(&first_media, argv[2], AVIO_FLAG_READ);
-        if (ret < 0)
-            goto end;
-    }
-
-    s = avformat_alloc_context();
-    if (!s) {
-        ret = AVERROR(ENOMEM);
-        goto end;
-    }
-    s->iformat   = &ff_hls_demuxer.p;
-    s->priv_data = av_mallocz(ff_hls_demuxer.priv_data_size);
-    if (!s->priv_data) {
-        ret = AVERROR(ENOMEM);
-        goto end;
-    }
-    *(const AVClass **)s->priv_data = ff_hls_demuxer.p.priv_class;
-    av_opt_set_defaults(s->priv_data);
-    c      = s->priv_data;
-    c->ctx = s;
-
-    parse_ret = parse_playlist(c, argv[1], NULL, top_level);
-    if (parse_ret >= 0 && first_media && c->n_playlists)
-        parse_ret = parse_playlist(c, argv[2], c->playlists[0], first_media);
-    print_playlists(c, parse_ret);
-
-end:
-    if (s && s->priv_data)
-        hls_close(s);
-    avformat_free_context(s);
-    avio_closep(&top_level);
-    avio_closep(&first_media);
-    if (ret < 0) {
-        fprintf(stderr, "%s\n", av_err2str(ret));
-        return 1;
-    }
-    return 0;
-}
diff --git a/tests/fate/libavformat.mak b/tests/fate/libavformat.mak
index 18270bbcab9..e7854626c33 100644
--- a/tests/fate/libavformat.mak
+++ b/tests/fate/libavformat.mak
@@ -72,49 +72,6 @@ FATE_LIBAVFORMAT-yes += fate-url
 fate-url: libavformat/tests/url$(EXESUF)
 fate-url: CMD = run libavformat/tests/url$(EXESUF)
 
-tests/data/hls-parse-master.m3u8: TAG = GEN
-tests/data/hls-parse-master.m3u8: | tests/data
-       $(Q)printf 
'#EXTM3U\n#EXT-X-STREAM-INF:BANDWIDTH=64000\na.m3u8\n#EXT-X-STREAM-INF:BANDWIDTH=32000\nb.m3u8\n'
 > $@
-
-tests/data/hls-parse-master-start.m3u8: TAG = GEN
-tests/data/hls-parse-master-start.m3u8: | tests/data
-       $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=1.5\n#EXT-X-STREAM-INF:BANDWIDTH=64000\na.m3u8\n#EXT-X-STREAM-INF:BANDWIDTH=32000\nb.m3u8\n'
 > $@
-
-tests/data/hls-parse-media.m3u8: TAG = GEN
-tests/data/hls-parse-media.m3u8: | tests/data
-       $(Q)printf 
'#EXTM3U\n#EXT-X-TARGETDURATION:2\n#EXTINF:2,\nseg0.ts\n#EXTINF:2,\nseg1.ts\n#EXTINF:2,\nseg2.ts\n'
 > $@
-
-tests/data/hls-parse-media-start.m3u8: TAG = GEN
-tests/data/hls-parse-media-start.m3u8: | tests/data
-       $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=4\n#EXT-X-TARGETDURATION:2\n#EXTINF:2,\nseg0.ts\n#EXTINF:2,\nseg1.ts\n#EXTINF:2,\nseg2.ts\n'
 > $@
-
-tests/data/hls-parse-media-start-endlist.m3u8: TAG = GEN
-tests/data/hls-parse-media-start-endlist.m3u8: | tests/data
-       $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=4\n#EXT-X-ENDLIST\n#EXT-X-TARGETDURATION:2\n#EXTINF:2,\nseg0.ts\n#EXTINF:2,\nseg1.ts\n#EXTINF:2,\nseg2.ts\n'
 > $@
-
-FATE_HLS_PARSE = fate-hls-parse-media-start           \
-                 fate-hls-parse-media-start-endlist   \
-                 fate-hls-parse-master-start          \
-                 fate-hls-parse-master-start-media    \
-                 fate-hls-parse-master-start-override \
-                 fate-hls-parse-master-media-start
-
-$(FATE_HLS_PARSE): libavformat/tests/hls$(EXESUF)
-fate-hls-parse-media-start: tests/data/hls-parse-media-start.m3u8
-fate-hls-parse-media-start: CMD = run libavformat/tests/hls$(EXESUF) 
$(TARGET_PATH)/tests/data/hls-parse-media-start.m3u8
-fate-hls-parse-media-start-endlist: 
tests/data/hls-parse-media-start-endlist.m3u8
-fate-hls-parse-media-start-endlist: CMD = run libavformat/tests/hls$(EXESUF) 
$(TARGET_PATH)/tests/data/hls-parse-media-start-endlist.m3u8
-fate-hls-parse-master-start: tests/data/hls-parse-master-start.m3u8
-fate-hls-parse-master-start: CMD = run libavformat/tests/hls$(EXESUF) 
$(TARGET_PATH)/tests/data/hls-parse-master-start.m3u8
-fate-hls-parse-master-start-media: tests/data/hls-parse-master-start.m3u8 
tests/data/hls-parse-media.m3u8
-fate-hls-parse-master-start-media: CMD = run libavformat/tests/hls$(EXESUF) 
$(TARGET_PATH)/tests/data/hls-parse-master-start.m3u8 
$(TARGET_PATH)/tests/data/hls-parse-media.m3u8
-fate-hls-parse-master-start-override: tests/data/hls-parse-master-start.m3u8 
tests/data/hls-parse-media-start.m3u8
-fate-hls-parse-master-start-override: CMD = run libavformat/tests/hls$(EXESUF) 
$(TARGET_PATH)/tests/data/hls-parse-master-start.m3u8 
$(TARGET_PATH)/tests/data/hls-parse-media-start.m3u8
-fate-hls-parse-master-media-start: tests/data/hls-parse-master.m3u8 
tests/data/hls-parse-media-start.m3u8
-fate-hls-parse-master-media-start: CMD = run libavformat/tests/hls$(EXESUF) 
$(TARGET_PATH)/tests/data/hls-parse-master.m3u8 
$(TARGET_PATH)/tests/data/hls-parse-media-start.m3u8
-
-FATE_LIBAVFORMAT-$(call ALLYES, HLS_DEMUXER FILE_PROTOCOL) += $(FATE_HLS_PARSE)
-
 FATE_LIBAVFORMAT-$(CONFIG_IMF_DEMUXER) += fate-imf
 fate-imf: libavformat/tests/imf$(EXESUF)
 fate-imf: CMD = run libavformat/tests/imf$(EXESUF)
diff --git a/tests/ref/fate/hls-parse-master-media-start 
b/tests/ref/fate/hls-parse-master-media-start
deleted file mode 100644
index 5bce43afa90..00000000000
--- a/tests/ref/fate/hls-parse-master-media-start
+++ /dev/null
@@ -1,3 +0,0 @@
-2 variant(s), 2 playlist(s)
-a.m3u8: live, start offset 4000000
-b.m3u8: live, no start offset
diff --git a/tests/ref/fate/hls-parse-master-start 
b/tests/ref/fate/hls-parse-master-start
deleted file mode 100644
index 57e88ecc7dc..00000000000
--- a/tests/ref/fate/hls-parse-master-start
+++ /dev/null
@@ -1,3 +0,0 @@
-2 variant(s), 2 playlist(s)
-a.m3u8: live, start offset 1500000
-b.m3u8: live, start offset 1500000
diff --git a/tests/ref/fate/hls-parse-master-start-media 
b/tests/ref/fate/hls-parse-master-start-media
deleted file mode 100644
index 57e88ecc7dc..00000000000
--- a/tests/ref/fate/hls-parse-master-start-media
+++ /dev/null
@@ -1,3 +0,0 @@
-2 variant(s), 2 playlist(s)
-a.m3u8: live, start offset 1500000
-b.m3u8: live, start offset 1500000
diff --git a/tests/ref/fate/hls-parse-master-start-override 
b/tests/ref/fate/hls-parse-master-start-override
deleted file mode 100644
index 57e88ecc7dc..00000000000
--- a/tests/ref/fate/hls-parse-master-start-override
+++ /dev/null
@@ -1,3 +0,0 @@
-2 variant(s), 2 playlist(s)
-a.m3u8: live, start offset 1500000
-b.m3u8: live, start offset 1500000
diff --git a/tests/ref/fate/hls-parse-media-start 
b/tests/ref/fate/hls-parse-media-start
deleted file mode 100644
index d007477fa2f..00000000000
--- a/tests/ref/fate/hls-parse-media-start
+++ /dev/null
@@ -1,2 +0,0 @@
-1 variant(s), 1 playlist(s)
-hls-parse-media-start.m3u8: live, start offset 4000000
diff --git a/tests/ref/fate/hls-parse-media-start-endlist 
b/tests/ref/fate/hls-parse-media-start-endlist
deleted file mode 100644
index ba15ebb74fe..00000000000
--- a/tests/ref/fate/hls-parse-media-start-endlist
+++ /dev/null
@@ -1,2 +0,0 @@
-1 variant(s), 1 playlist(s)
-hls-parse-media-start-endlist.m3u8: finished, start offset 4000000
-- 
2.54.0


From 6643d6a38e37d4f0d166ba4657c2fa7af671b079 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 04:09:54 +0100
Subject: [PATCH 3/4] avformat/hls: parse the EXT-X-START attributes in any
 order
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

TIME-OFFSET was only read as the first attribute of EXT-X-START, so a
tag with PRECISE first was ignored. RFC 8216 4.2 does not order the
pairs of an attribute-list. Parse it with ff_parse_key_value() as the
other attribute lists are.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavformat/hls.c                     | 21 ++++++++++++++++++---
 tests/fate/demux.mak                  |  2 +-
 tests/ref/fate/hls-start-master-demux |  2 +-
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index c68b5e88cf5..23c7fbafd55 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -578,6 +578,20 @@ static void handle_init_section_args(void *context, const 
char *key,
     }
 }
 
+struct start_info {
+    char time_offset[MAX_FIELD_LEN];
+};
+
+static void handle_start_args(void *context, const char *key,
+                              int key_len, char **dest, int *dest_len)
+{
+    struct start_info *info = context;
+    if (!strncmp(key, "TIME-OFFSET=", key_len)) {
+        *dest     =        info->time_offset;
+        *dest_len = sizeof(info->time_offset);
+    }
+}
+
 struct rendition_info {
     char type[16];
     char uri[MAX_URL_SIZE];
@@ -1142,9 +1156,10 @@ static int parse_playlist(HLSContext *c, const char *url,
             }
 
         } else if (av_strstart(line, "#EXT-X-START:", &ptr)) {
-            const char *time_offset_value = NULL;
-            if (av_strstart(ptr, "TIME-OFFSET=", &time_offset_value)) {
-                double offset = strtod(time_offset_value, NULL) * AV_TIME_BASE;
+            struct start_info info = {0};
+            ff_parse_key_value(ptr, handle_start_args, &info);
+            if (info.time_offset[0]) {
+                double offset = strtod(info.time_offset, NULL) * AV_TIME_BASE;
                 if (offset >= -0x1p63 && offset < 0x1p63) {
                     start_time_offset = offset;
                     time_offset_flag  = 1;
diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index e178a8883a8..aa6f2795ba1 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -243,7 +243,7 @@ tests/data/hls-start-master.m3u8: 
ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
        $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=0.5\n#EXT-X-TARGETDURATION:0\n#EXTINF:0.144,\nhls-start-0.ts\n#EXTINF:0.144,\nhls-start-1.ts\n#EXTINF:0.144,\nhls-start-2.ts\n#EXTINF:0.144,\nhls-start-3.ts\n'
 > tests/data/hls-start-media.m3u8
        $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=0.5\n#EXT-X-ENDLIST\n#EXT-X-TARGETDURATION:0\n#EXTINF:0.144,\nhls-start-0.ts\n#EXTINF:0.144,\nhls-start-1.ts\n#EXTINF:0.144,\nhls-start-2.ts\n#EXTINF:0.144,\nhls-start-3.ts\n'
 > tests/data/hls-start-endlist.m3u8
        $(Q)printf 
'#EXTM3U\n#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="a",NAME="a",URI="hls-start-rendition.m3u8"\n#EXT-X-STREAM-INF:BANDWIDTH=64000,AUDIO="a"\nhls-start-media.m3u8\n'
 > tests/data/hls-start-variant.m3u8
-       $(Q)printf 
'#EXTM3U\n#EXT-X-START:TIME-OFFSET=0.1\n#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="a",NAME="a",URI="hls-start-rendition.m3u8"\n#EXT-X-STREAM-INF:BANDWIDTH=64000,AUDIO="a"\nhls-start-media.m3u8\n'
 > $@
+       $(Q)printf 
'#EXTM3U\n#EXT-X-START:PRECISE=NO,TIME-OFFSET=0.1\n#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="a",NAME="a",URI="hls-start-rendition.m3u8"\n#EXT-X-STREAM-INF:BANDWIDTH=64000,AUDIO="a"\nhls-start-media.m3u8\n'
 > $@
 
 FATE_HLS_START = fate-hls-start-master-demux  \
                  fate-hls-start-variant-demux \
diff --git a/tests/ref/fate/hls-start-master-demux 
b/tests/ref/fate/hls-start-master-demux
index c358cb243a9..fd698bea2d3 100644
--- a/tests/ref/fate/hls-start-master-demux
+++ b/tests/ref/fate/hls-start-master-demux
@@ -16,4 +16,4 @@ 
packet|codec_type=audio|stream_index=0|pts=45360|pts_time=0.504000|dts=45360|dts
 
packet|codec_type=audio|stream_index=1|pts=45360|pts_time=0.504000|dts=45360|dts_time=0.504000|duration=6480|duration_time=0.072000|size=1440|pos=12784|flags=K__|data_hash=CRC32:cb00dd5b|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=192
 
stream|index=0|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=fltp|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x0|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=64000|tag:comment=a
 
stream|index=1|codec_name=mp2|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|mime_codec_string=mp4a.40.33|sample_fmt=unknown|sample_rate=16000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=0x1|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=160000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:variant_bitrate=64000
-format|filename=hls-start-master.m3u8|nb_streams=2|nb_programs=1|nb_stream_groups=0|format_name=hls|start_time=0.000000|duration=N/A|size=179|bit_rate=320000|probe_score=100
+format|filename=hls-start-master.m3u8|nb_streams=2|nb_programs=1|nb_stream_groups=0|format_name=hls|start_time=0.000000|duration=N/A|size=190|bit_rate=320000|probe_score=100
-- 
2.54.0


From 5fe37a2b4f1e492fc7adcb9b42f0af39f1fd2bd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 04:10:20 +0100
Subject: [PATCH 4/4] avformat/hls: fix the EXT-X-START warning messages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavformat/hls.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 23c7fbafd55..eff7477223f 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1164,12 +1164,12 @@ static int parse_playlist(HLSContext *c, const char 
*url,
                     start_time_offset = offset;
                     time_offset_flag  = 1;
                 } else {
-                    av_log(c->ctx, AV_LOG_WARNING, "TIME-OFFSET value is"
-                                                    "invalid, it will be 
ignored");
+                    av_log(c->ctx, AV_LOG_WARNING, "TIME-OFFSET value is "
+                                                    "invalid, it will be 
ignored\n");
                 }
             } else {
-                av_log(c->ctx, AV_LOG_WARNING, "#EXT-X-START value is"
-                                                "invalid, it will be ignored");
+                av_log(c->ctx, AV_LOG_WARNING, "#EXT-X-START value is "
+                                                "invalid, it will be 
ignored\n");
                 continue;
             }
         } else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
-- 
2.54.0

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

Reply via email to