diff mbox

[FFmpeg-devel] lavf/img2dec: Increase score for jpgs without EOI

Message ID 201701011440.25992.cehoyos@ag.or.at
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Jan. 1, 2017, 1:40 p.m. UTC
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 <cehoyos@ag.or.at>
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(+)

Comments

Michael Niedermayer Jan. 1, 2017, 3:41 p.m. UTC | #1
On Sun, Jan 01, 2017 at 02:40:25PM +0100, Carl Eugen Hoyos wrote:
> 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

>  img2dec.c |    2 ++
>  1 file changed, 2 insertions(+)
> 4f70ba80770627f6fb16271fea16b4bf29335289  0001-lavf-img2dec-Increase-detection-score-of-jpgs-withou.patch
> From 1abe53bf7826b23f5aca7b5b6108e6d309b21b86 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <cehoyos@ag.or.at>
> 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.

probably ok

thx

[...]
Carl Eugen Hoyos Jan. 1, 2017, 6:57 p.m. UTC | #2
2017-01-01 16:41 GMT+01:00 Michael Niedermayer <michael@niedermayer.cc>:
> On Sun, Jan 01, 2017 at 02:40:25PM +0100, Carl Eugen Hoyos wrote:
>> 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
>
>>  img2dec.c |    2 ++
>>  1 file changed, 2 insertions(+)
>> 4f70ba80770627f6fb16271fea16b4bf29335289  0001-lavf-img2dec-Increase-detection-score-of-jpgs-withou.patch
>> From 1abe53bf7826b23f5aca7b5b6108e6d309b21b86 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <cehoyos@ag.or.at>
>> 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.
>
> probably ok

Pushed with a smaller score.

Thank you, Carl Eugen
diff mbox

Patch

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;
 }