Fixes ticket #6113

The previous version of #jpeg_probe returned AVPROBE_SCORE_EXTENSION / 2 for 
finding the header of the jpeg and only returned AVPROBE_SCORE_EXTENSION for 
parsing the full file and finding the tail tag #EOI at the end, as a result the 
jpeg format was overshadowed by the generic image2 format.
This way it is closer to #png_probe which returns AVPROBE_SCORE_MAX.

Signed-off-by: lp64ace <[email protected]>
---
 libavformat/img2dec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index d5718eff41..27e797f55a 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -801,9 +801,9 @@ static int jpeg_probe(const AVProbeData *p)
     }
 
     if (state == EOI)
-        return AVPROBE_SCORE_EXTENSION + 1;
+        return AVPROBE_SCORE_MAX - 1;
     if (state == SOS)
-        return AVPROBE_SCORE_EXTENSION / 2 + got_header;
+        return AVPROBE_SCORE_EXTENSION + got_header;
     return AVPROBE_SCORE_EXTENSION / 8 + 1;
 }
 
-- 
2.47.3

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to