mp3: Tweak the probe scores
authorLuca Barbato <lu_zero@gentoo.org>
Sat, 6 Dec 2014 11:32:25 +0000 (12:32 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Mon, 12 Jan 2015 22:18:01 +0000 (23:18 +0100)
Having more than 10 consecutive frames decoded as mp3 should be
considered a clear signal that the sample is mp3 and not mpegps.

Reported-By: Florian Iragne <florian@iragne.fr>
CC: libav-stable@libav.org
libavformat/mp3dec.c

index 14d8254..ce734b7 100644 (file)
@@ -80,7 +80,10 @@ static int mp3_read_probe(AVProbeData *p)
     }
     // keep this in sync with ac3 probe, both need to avoid
     // issues with MPEG-files!
-    if (first_frames >= 4) return AVPROBE_SCORE_EXTENSION + 1;
+    if (first_frames >= 10)
+        return AVPROBE_SCORE_EXTENSION + 5;
+    if (first_frames >= 4)
+        return AVPROBE_SCORE_EXTENSION + 1;
 
     if (max_frames) {
         int pes = 0, i;