From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id EFCDF4CDF6 for ; Mon, 11 Aug 2025 08:37:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 426DA68D239; Mon, 11 Aug 2025 11:37:54 +0300 (EEST) Received: from 472d2aa5cb20 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 19AB2687C9E for ; Mon, 11 Aug 2025 11:37:53 +0300 (EEST) MIME-Version: 1.0 From: quink To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] =?utf-8?q?=5BPATCH=5D_avformat/mp3dec=3A_Workarou?= =?utf-8?q?nd_mp3_detection_failure_=28PR_=2320212=29?= X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Message-Id: <20250811083754.426DA68D239@ffbox0-bg.ffmpeg.org> Date: Mon, 11 Aug 2025 11:37:54 +0300 (EEST) Archived-At: List-Archive: List-Post: PR #20212 opened by quink URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20212 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20212.patch A set of files begins with the following byte sequence. 00000000 4c 41 4d 45 33 2e 31 30 30 aa aa aa aa aa aa aa |LAME3.100.......| 00000010 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * It seems they are encoded with lame, but missing header bytes at the beginning. Signed-off-by: Zhao Zhili >From e24f7b8d0fbc4295b3dfc9832d7b552086f45ff0 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Mon, 11 Aug 2025 15:23:36 +0800 Subject: [PATCH] avformat/mp3dec: Workaround mp3 detection failure A set of files begins with the following byte sequence. 00000000 4c 41 4d 45 33 2e 31 30 30 aa aa aa aa aa aa aa |LAME3.100.......| 00000010 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * It seems they are encoded with lame, but missing header bytes at the beginning. Signed-off-by: Zhao Zhili --- libavformat/mp3dec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 31eeb68ebb..fd692a9c76 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -121,8 +121,11 @@ static int mp3_read_probe(const AVProbeData *p) // issues with MPEG-files! 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) + else if (max_frames>=4 && p->buf_size < 2*max_framesizes) { + if (!memcmp(p->buf, "LAME3.100", sizeof("LAME3.100") - 1)) + return AVPROBE_SCORE_EXTENSION - 2; + 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; -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".