* [FFmpeg-devel] [PR] lavf/mp3dec: remove ID3v2 check in mp3_read_probe (PR #21557)
@ 2026-01-23 10:40 Jun Zhao via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: Jun Zhao via ffmpeg-devel @ 2026-01-23 10:40 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Jun Zhao
PR #21557 opened by Jun Zhao (mypopydev)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21557
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21557.patch
Since 33dd3485ba (lavf/format: skip multiple consecutive ID3v2 tags
in probe), av_probe_input_format3() skips all ID3v2 tags before
calling format probes, so mp3_read_probe() will never see ID3v2 data
at the start of the buffer. This makes the ff_id3v2_match check
dead code.
Additionally, the original logic of returning a low score when only
ID3v2 tags were visible was questionable - format.c already handles
this case properly by using file extension matching with appropriate
scores when ID3 tags consume the probe buffer.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
>From 8d5c9f38d8df0ac9575b3c570ec47e39d20f8234 Mon Sep 17 00:00:00 2001
From: Jun Zhao <barryjzhao@tencent.com>
Date: Fri, 23 Jan 2026 16:10:20 +0800
Subject: [PATCH] lavf/mp3dec: remove ID3v2 check in mp3_read_probe
Since 33dd3485ba (lavf/format: skip multiple consecutive ID3v2 tags
in probe), av_probe_input_format3() skips all ID3v2 tags before
calling format probes, so mp3_read_probe() will never see ID3v2 data
at the start of the buffer. This makes the ff_id3v2_match check
dead code.
Additionally, the original logic of returning a low score when only
ID3v2 tags were visible was questionable - format.c already handles
this case properly by using file extension matching with appropriate
scores when ID3 tags consume the probe buffer.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
libavformat/mp3dec.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 5b153c7c9e..912e5da502 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -122,8 +122,6 @@ static int mp3_read_probe(const AVProbeData *p)
if (first_frames>=7) return AVPROBE_SCORE_EXTENSION + 1;
else if (max_frames>200 && p->buf_size < 2*max_framesizes)return AVPROBE_SCORE_EXTENSION;
else if (max_frames>=4 && p->buf_size < 2*max_framesizes) return AVPROBE_SCORE_EXTENSION / 2;
- else if (ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_tag_len(buf0) >= p->buf_size)
- return p->buf_size < PROBE_BUF_MAX ? AVPROBE_SCORE_EXTENSION / 4 : AVPROBE_SCORE_EXTENSION - 2;
else if (first_frames > 1 && whole_used) return 5;
else if (max_frames>=1 && p->buf_size < 10*max_framesizes) return 1;
else return 0;
--
2.52.0
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-23 10:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-23 10:40 [FFmpeg-devel] [PR] lavf/mp3dec: remove ID3v2 check in mp3_read_probe (PR #21557) Jun Zhao via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git