PR #25271 opened by Forgejo_Fairy
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25271
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25271.patch

The HLS seek fixture leaves MPEG-2 encoder threading automatic. With one 
available CPU, two sampled packets have sizes 2289 and 3904 rather than the 
reference's 2330 and 3860, causing the exact failure reported in #24579.

Pin the output video encoder with `-threads:v 1` and update those two reference 
values. Packet timestamps, positions, and seek results remain unchanged.

Validation on x86-64 Linux with GCC 13.3 and pthreads: unmodified release/9.0 
at 6dfaba896f failed all three single-CPU runs and passed three runs each with 
two and eight CPUs. With this patch, all nine fresh-fixture runs pass and 
produce identical test output. CPU availability was controlled with `taskset`; 
generated `tests/data/hls-seek*.m3u8` and `.ts` files were removed before each 
run. `git diff --check` passes.

The test failure is also verified at e27ad5760c0c, while its parent 
caa3fa6af070 passes. Current master selects different packets and needs only 
the companion thread-count change.

Fixes #24579.


>From cdbd4487d922c864eea97c4af4ade1fc1e183068 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Tue, 20 Oct 2026 21:55:24 +0000
Subject: [PATCH] tests/fate/seek: make HLS fixture independent of CPU count

The HLS seek fixture leaves the MPEG-2 encoder thread count automatic.
On a single CPU, two sampled video packets have sizes 2289 and 3904
instead of the multithreaded reference's 2330 and 3860, failing FATE.

Pin the video encoder to one thread and update the two affected packet
sizes. Packet timestamps, positions, and seek results are unchanged.

Validated fate-seek-hls with freshly generated input three times each
under CPU affinity masks containing one, two, and eight CPUs. Before
this change the single-CPU runs reproduce the exact reported failure;
afterwards all nine runs pass with identical test output.

Fixes: #24579
Assisted-by: Fairy
---
 tests/fate/seek.mak | 2 +-
 tests/ref/seek/hls  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/fate/seek.mak b/tests/fate/seek.mak
index fa57d60841c..d33cef4d928 100644
--- a/tests/fate/seek.mak
+++ b/tests/fate/seek.mak
@@ -204,7 +204,7 @@ tests/data/hls-seek.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | 
tests/data
        $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
         -f lavfi -i "testsrc2=size=128x72:rate=10:d=6" \
         -f lavfi -i "aevalsrc=cos(2*PI*t)*sin(2*PI*(440+4*t)*t):d=6" \
-        -map 0:v -map 1:a -c:v mpeg2video -bf 2 -g 15 -dct int -idct int 
-flags +bitexact -c:a mp2fixed \
+        -map 0:v -map 1:a -c:v mpeg2video -threads:v 1 -bf 2 -g 15 -dct int 
-idct int -flags +bitexact -c:a mp2fixed \
         -f hls -hls_time 2 -hls_list_size 0 \
         -var_stream_map "v:0,agroup:a a:0,agroup:a,default:yes" 
-master_pl_name hls-seek.m3u8 \
         -hls_segment_filename $(TARGET_PATH)/tests/data/hls-seek-s%v-%d.ts \
diff --git a/tests/ref/seek/hls b/tests/ref/seek/hls
index 0f2085916b0..0c16be8747f 100644
--- a/tests/ref/seek/hls
+++ b/tests/ref/seek/hls
@@ -6,7 +6,7 @@ ret: 0         st: 1 flags:1 dts: 1.400000 pts: 1.500000 pos:   
 564 size:  3913
 ret: 0         st: 0 flags:0  ts: 0.788333
 ret: 0         st: 1 flags:1 dts: 1.400000 pts: 1.500000 pos:    564 size:  
3913
 ret: 0         st: 0 flags:1  ts: 1.682500
-ret: 0         st: 1 flags:0 dts: 1.600000 pts: 1.600000 pos:   8836 size:  
2330
+ret: 0         st: 1 flags:0 dts: 1.600000 pts: 1.600000 pos:   8836 size:  
2289
 ret: 0         st: 1 flags:0  ts: 2.576667
 ret: 0         st: 0 flags:1 dts: 2.586233 pts: 2.586233 pos:  55836 size:  
1254
 ret: 0         st: 1 flags:1  ts: 3.470833
@@ -40,7 +40,7 @@ ret: 0         st: 0 flags:1 dts: 3.108689 pts: 3.108689 pos: 
 82156 size:  1254
 ret: 0         st:-1 flags:1  ts: 3.989173
 ret: 0         st: 1 flags:1 dts: 1.400000 pts: 1.500000 pos:    564 size:  
3913
 ret: 0         st: 0 flags:0  ts: 4.883344
-ret: 0         st: 1 flags:0 dts: 4.800000 pts: 5.100000 pos:  20492 size:  
3860
+ret: 0         st: 1 flags:0 dts: 4.800000 pts: 5.100000 pos:  20492 size:  
3904
 ret: 0         st: 0 flags:1  ts:-0.222489
 ret: 0         st: 1 flags:1 dts: 1.400000 pts: 1.500000 pos:    564 size:  
3913
 ret: 0         st: 1 flags:0  ts: 0.671678
-- 
2.54.0

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

Reply via email to