Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Jun Zhao via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Jun Zhao <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] lavf/mp3dec: remove ID3v2 check in mp3_read_probe (PR #21557)
Date: Fri, 23 Jan 2026 10:40:02 -0000
Message-ID: <176916480302.25.8867835530478004321@4457048688e7> (raw)

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

                 reply	other threads:[~2026-01-23 10:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176916480302.25.8867835530478004321@4457048688e7 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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