From patchwork Sun Jan 1 13:40:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 2009 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp3601940vsb; Sun, 1 Jan 2017 05:40:37 -0800 (PST) X-Received: by 10.194.52.42 with SMTP id q10mr45106982wjo.50.1483278037107; Sun, 01 Jan 2017 05:40:37 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 127si65950765wmv.35.2017.01.01.05.40.36; Sun, 01 Jan 2017 05:40:37 -0800 (PST) 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 F02BD6899E0; Sun, 1 Jan 2017 15:40:30 +0200 (EET) 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 457D2689982 for ; Sun, 1 Jan 2017 15:40:24 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cNgN9-000714-8S for ffmpeg-devel@ffmpeg.org; Sun, 01 Jan 2017 14:40:27 +0100 Received: from [192.168.1.3] ([80.110.108.6]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id T1gS1u00N08Jvx4011gTMJ; Sun, 01 Jan 2017 14:40:27 +0100 X-SourceIP: 80.110.108.6 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Sun, 1 Jan 2017 14:40:25 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201701011440.25992.cehoyos@ag.or.at> Subject: [FFmpeg-devel] lavf/img2dec: Increase score for jpgs without EOI 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! For large jpeg files, EOI may never be seen by the probe function but several jpeg tags are correctly identified. Please comment, Carl Eugen From 1abe53bf7826b23f5aca7b5b6108e6d309b21b86 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 1 Jan 2017 14:35:21 +0100 Subject: [PATCH] lavf/img2dec: Increase detection score of jpgs without EOI. Also increases the score for large jpeg files. Fixes autodetection for the file from mpv issue 3973. --- libavformat/img2dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index c8d7031..8967630 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -755,6 +755,8 @@ static int jpeg_probe(AVProbeData *p) if (state == EOI) return AVPROBE_SCORE_EXTENSION + 1; + if (state == SOS) + return AVPROBE_SCORE_EXTENSION - 1; return AVPROBE_SCORE_EXTENSION / 8; }