This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit cd3a199685992ac6fa41da5e0ff3da249e70250a
Author:     liuyun <[email protected]>
AuthorDate: Thu Oct 22 16:26:05 2026 +0800
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Sun Nov 8 13:07:42 2026 +0000

    avformat/mpegts: don't return SCORE_MAX for exactly CHECK_COUNT aligned 
packets
    
    This reverts 0eb2d1f64a. With the minimal 2048-byte probe buffer, ten
    0x47 bytes at the 192-byte stride, each with a non-zero
    adaptation_field_control three bytes later, reach AVPROBE_SCORE_MAX.
    That outscores demuxers with a real signature such as wav
    (AVPROBE_SCORE_MAX - 1). A periodic tone (e.g. 1 kHz in 16 kHz mono
    s16le) repeats the same samples every 96 samples (192 bytes), so a byte
    that happens to be 0x47 at one sync position stays 0x47 at every sync
    position. Plain WAV files, including ones written by ffmpeg, were
    therefore probed as mpegts and failed to open with "End of file".
    
    The branch was added so a 1x1 PNG in front of an MPEG-TS segment would
    not be probed as png_pipe. That is now handled in png_probe() itself
    (a38ce70f0e), and the png-prefix probe tests still pass without it.
    
    Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/25221
    Signed-off-by: liuyun <[email protected]>
---
 libavformat/mpegts.c          | 2 --
 tests/ref/fate/ts-demux       | 2 +-
 tests/ref/fate/ts-opus-demux  | 2 +-
 tests/ref/fate/ts-small-demux | 2 +-
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 6e252e63fc..ae4d177083 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -3497,8 +3497,6 @@ static int mpegts_probe(const AVProbeData *p)
 
     if        (check_count > CHECK_COUNT && sumscore > 6) {
         return AVPROBE_SCORE_MAX   + sumscore - CHECK_COUNT;
-    } else if (check_count >= CHECK_COUNT && sumscore >= CHECK_COUNT) {
-        return AVPROBE_SCORE_MAX   + sumscore - CHECK_COUNT;
     } else if (check_count >= CHECK_COUNT && sumscore > 6) {
         return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
     } else if (check_count >= CHECK_COUNT && maxscore > 6) {
diff --git a/tests/ref/fate/ts-demux b/tests/ref/fate/ts-demux
index 9f6307a452..2227c5021e 100644
--- a/tests/ref/fate/ts-demux
+++ b/tests/ref/fate/ts-demux
@@ -26,4 +26,4 @@ 
packet|codec_type=audio|stream_index=2|pts=3912645580|pts_time=43473.839778|dts=
 
stream|index=0|codec_name=mpeg2video|profile=4|level=4|codec_type=video|codec_tag_string=[2][0][0][0]|codec_tag=0x0002|width=1280|height=720|coded_width=0|coded_height=0|has_b_frames=1|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|ts_id=32776|ts_packetsize=188|id=0x31|r_frame_rate=60000/1001|avg_frame_rate=60000/1001|time_base=1/90000|start_pt
 [...]
 
stream|index=1|codec_name=ac3|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[6][0][0][0]|codec_tag=0x0006|mime_codec_string=ac-3|sample_fmt=fltp|sample_rate=48000|channels=6|channel_layout=5.1(side)|bits_per_sample=0|initial_padding=0|seek_preroll=0|dmix_mode=0|ltrt_cmixlev=0.000000|ltrt_surmixlev=0.000000|loro_cmixlev=0.000000|loro_surmixlev=0.000000|ts_id=32776|ts_packetsize=188|id=0x34|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=3912633305|start_time=
 [...]
 
stream|index=2|codec_name=ac3|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[6][0][0][0]|codec_tag=0x0006|mime_codec_string=ac-3|sample_fmt=fltp|sample_rate=48000|channels=2|channel_layout=stereo|bits_per_sample=0|initial_padding=0|seek_preroll=0|dmix_mode=0|ltrt_cmixlev=0.000000|ltrt_surmixlev=0.000000|loro_cmixlev=0.000000|loro_surmixlev=0.000000|ts_id=32776|ts_packetsize=188|id=0x35|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=3912634060|start_time=434
 [...]
-format|filename=mp3ac325-4864-small.ts|nb_streams=3|nb_programs=1|nb_stream_groups=0|format_name=mpegts|start_time=43473.703389|duration=0.622889|size=512000|bit_rate=6575810|probe_score=100
+format|filename=mp3ac325-4864-small.ts|nb_streams=3|nb_programs=1|nb_stream_groups=0|format_name=mpegts|start_time=43473.703389|duration=0.622889|size=512000|bit_rate=6575810|probe_score=50
diff --git a/tests/ref/fate/ts-opus-demux b/tests/ref/fate/ts-opus-demux
index 04038ae346..8953f10b93 100644
--- a/tests/ref/fate/ts-opus-demux
+++ b/tests/ref/fate/ts-opus-demux
@@ -511,4 +511,4 @@ 
packet|codec_type=audio|stream_index=0|pts=916200|pts_time=10.180000|dts=916200|
 
packet|codec_type=audio|stream_index=0|pts=918000|pts_time=10.200000|dts=918000|dts_time=10.200000|duration=1800|duration_time=0.020000|size=761|pos=510044|flags=K__|data_hash=CRC32:75113c11|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=189
 
packet|codec_type=audio|stream_index=0|pts=919800|pts_time=10.220000|dts=919800|dts_time=10.220000|duration=1800|duration_time=0.020000|size=759|pos=510984|flags=K__|data_hash=CRC32:59fc266f|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=189
 
stream|index=0|codec_name=opus|profile=unknown|level=-99|codec_type=audio|codec_tag_string=Opus|codec_tag=0x7375704f|mime_codec_string=opus|sample_fmt=fltp|sample_rate=48000|channels=8|channel_layout=7.1|bits_per_sample=0|initial_padding=0|seek_preroll=0|ts_id=51338|ts_packetsize=188|id=0x44|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=919800|duration=10.220000|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read
 [...]
-format|filename=test-8-7.1.opus-small.ts|nb_streams=1|nb_programs=1|nb_stream_groups=0|format_name=mpegts|start_time=0.000000|duration=10.220000|size=512000|bit_rate=400782|probe_score=100
+format|filename=test-8-7.1.opus-small.ts|nb_streams=1|nb_programs=1|nb_stream_groups=0|format_name=mpegts|start_time=0.000000|duration=10.220000|size=512000|bit_rate=400782|probe_score=50
diff --git a/tests/ref/fate/ts-small-demux b/tests/ref/fate/ts-small-demux
index adac491878..d15ac35809 100644
--- a/tests/ref/fate/ts-small-demux
+++ b/tests/ref/fate/ts-small-demux
@@ -73,4 +73,4 @@ 
packet|codec_type=video|stream_index=0|pts=552000|pts_time=6.133333|dts=552000|d
 
packet|codec_type=video|stream_index=0|pts=558000|pts_time=6.200000|dts=558000|dts_time=6.200000|duration=6000|duration_time=0.066667|size=16|pos=15792|flags=___|data_hash=CRC32:27b943ef|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=224
 
packet|codec_type=video|stream_index=0|pts=564000|pts_time=6.266667|dts=564000|dts_time=6.266667|duration=6000|duration_time=0.066667|size=16|pos=16356|flags=___|data_hash=CRC32:f7116111|side_datum/mpegts_stream_id:side_data_type=MPEGTS
 Stream ID|side_datum/mpegts_stream_id:id=224
 
stream|index=0|codec_name=h264|profile=578|level=10|codec_type=video|codec_tag_string=[27][0][0][0]|codec_tag=0x001b|mime_codec_string=avc1.42c00a|width=82|height=144|coded_width=82|coded_height=144|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=41:72|pix_fmt=yuv420p|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|is_avc=false|nal_length_size=0|ts_id=1|ts_packetsize=188|id=0x100|r_frame_rate=
 [...]
-format|filename=h264small.ts|nb_streams=1|nb_programs=1|nb_stream_groups=0|format_name=mpegts|start_time=1.400000|duration=4.933333|size=16544|bit_rate=26828|probe_score=100
+format|filename=h264small.ts|nb_streams=1|nb_programs=1|nb_stream_groups=0|format_name=mpegts|start_time=1.400000|duration=4.933333|size=16544|bit_rate=26828|probe_score=50

-- 
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]

Reply via email to