From patchwork Sat May 12 16:33:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8928 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp2130963jad; Sat, 12 May 2018 09:35:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpSanj3vHkcDwJBAwkuRQ+aZnZNktTEjvEOn/7/1XhtmiXhwbzDu+bCTLRwMu235NBlhH9H X-Received: by 2002:a1c:5451:: with SMTP id p17-v6mr1566496wmi.26.1526142943390; Sat, 12 May 2018 09:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526142943; cv=none; d=google.com; s=arc-20160816; b=FTjwqaH+2nDvgOT8abNFiwG7ETuBK7Ai+BSr78moTHJrIG+8eyLL8EbV4fouXXxSL8 ThnA+JpvGxOPeRjtPo9XUvfYXmUe8nXWU1tNhB3TMwf02krSPQykHgmp+7JKQa5cMMiR Dm2oLCS/6PpAgVPnp4Mkw7ohUysVqc0MsGDz6PnuKYQw9h+gCNBeR50aqimjsA0ej2nr aSLZZnJaCs3kiRs+duyx8MjBDTqLI+x7MK+tCi5T3Vve9hw1Zl/48KGccxKUKePGilmV 55qXymt1ac7IR0/gkuV4+S4PtMIfL4t4zMowAoQW8KRbFO8wR7twJn4wCHDSCGZ8QMjQ a10w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=UdjlvZBYGUIqdwsUbZNP5N8CoHg6rBaonofBhmprqEc=; b=S1v/O4oxAKLNSxZ+6uYLXQ/BhNOrzC9JHMmyBPVJ8o6eTL0qpkawn3tVIWqEEgt47S 3Jel2cb8lyhg8m5rF2lBimMc7g7ZeOITsO2wXKnfgx3c1R6qmfhzFJ+vDDcb/x/uKghC NKuArPinln8w4e/HW12F7LNqcSqNS8QTavQ/n5P6xjWGHmlOQRiwjaIzImbGq46EDmfD vO5X3htbZghvM3PlOS9ipEjA1E4IT9WL1gmaXGwvb6RsZZDPO2nVhsaUd1F7V+kEeg4m k0A/EO3r3lrRAYXz9qT2L0CbOnfX7PIfpzt9ZIV17L+e2mO5Us82PjSxyEJOxROHC1Cz H+8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z125-v6si2648306wme.160.2018.05.12.09.35.43; Sat, 12 May 2018 09:35:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 181BE68A91D; Sat, 12 May 2018 19:34:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3C855689A0C for ; Sat, 12 May 2018 19:34:28 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fHXU9-0001Cy-8a for ffmpeg-devel@ffmpeg.org; Sat, 12 May 2018 18:35:05 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id lUaz1x00F0S5wYM01Ub0dS; Sat, 12 May 2018 18:35:00 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 12 May 2018 18:33:29 +0200 Message-Id: <20180512163329.18380-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512163329.18380-1-michael@niedermayer.cc> References: <20180512163329.18380-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 5/5] avformat/mp3dec: require 90% of a file to be mp3 if only 1 mp3 frame is found in sequence X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This eliminates several low score detections of non mp3 files Signed-off-by: Michael Niedermayer --- libavformat/mp3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index d419f8c9fe..ef884934e1 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -112,7 +112,7 @@ static int mp3_read_probe(AVProbeData *p) 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 < 2*max_framesizes) return 1; + else if(max_frames>=1 && p->buf_size < 10*max_framesizes) return 1; else return 0; //mpegps_mp3_unrecognized_format.mpg has max_frames=3 }