diff mbox

[FFmpeg-devel] avformat/mpeg: Adjust vid probe threshold to correct mis-detection

Message ID 20161115190642.4738-1-michael@niedermayer.cc
State Accepted
Commit 4e5049a2303ae7fe74216a83206239e4de42c965
Headers show

Commit Message

Michael Niedermayer Nov. 15, 2016, 7:06 p.m. UTC
Fixes: _ij.mp3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

wm4 Nov. 15, 2016, 8:12 p.m. UTC | #1
On Tue, 15 Nov 2016 20:06:42 +0100
Michael Niedermayer <michael@niedermayer.cc> wrote:

> Fixes: _ij.mp3
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/mpeg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
> index 1c441c5..423877e 100644
> --- a/libavformat/mpeg.c
> +++ b/libavformat/mpeg.c
> @@ -112,7 +112,7 @@ static int mpegps_probe(AVProbeData *p)
>                            : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
>      if ((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys &&
>          !pspack && p->buf_size > 2048 && vid + audio > invalid) /* PES stream */
> -        return (audio > 12 || vid > 3 + 2 * invalid) ? AVPROBE_SCORE_EXTENSION + 2
> +        return (audio > 12 || vid > 6 + 2 * invalid) ? AVPROBE_SCORE_EXTENSION + 2
>                                                       : AVPROBE_SCORE_EXTENSION / 2;
>  
>      // 02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1

Works for me (I reported this, so same test sample). But I'm not
convinced whether it's the right solution. Not opposed to applying it
either since it at least makes the bogus heuristic return better
results.

I also have a hard time believing that detecting straight mp3 or
mpeg-ps is so complex.
Michael Niedermayer Nov. 22, 2016, 11:55 p.m. UTC | #2
On Tue, Nov 15, 2016 at 08:06:42PM +0100, Michael Niedermayer wrote:
> Fixes: _ij.mp3
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/mpeg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

[...]
diff mbox

Patch

diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 1c441c5..423877e 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -112,7 +112,7 @@  static int mpegps_probe(AVProbeData *p)
                           : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
     if ((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys &&
         !pspack && p->buf_size > 2048 && vid + audio > invalid) /* PES stream */
-        return (audio > 12 || vid > 3 + 2 * invalid) ? AVPROBE_SCORE_EXTENSION + 2
+        return (audio > 12 || vid > 6 + 2 * invalid) ? AVPROBE_SCORE_EXTENSION + 2
                                                      : AVPROBE_SCORE_EXTENSION / 2;
 
     // 02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1