changeset 5238:c872818a8e1f libavformat

Sync AC3 probe values with MP3 probe values, they have to avoid similar issues. This fixes ffmpeg-generated files with -acodec ac3 being detected as raw ac3 instead of MPEG.
author reimar
date Tue, 29 Sep 2009 10:23:47 +0000
parents 496723640f94
children 4d1a325b53cc
files mp3.c raw.c
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mp3.c	Tue Sep 29 10:12:18 2009 +0000
+++ b/mp3.c	Tue Sep 29 10:23:47 2009 +0000
@@ -63,6 +63,8 @@
         if(buf == buf0)
             first_frames= frames;
     }
+    // keep this in sync with ac3 probe, both need to avoid
+    // issues with MPEG-files!
     if   (first_frames>=4) return AVPROBE_SCORE_MAX/2+1;
     else if(max_frames>500)return AVPROBE_SCORE_MAX/2;
     else if(max_frames>=4) return AVPROBE_SCORE_MAX/4;
--- a/raw.c	Tue Sep 29 10:12:18 2009 +0000
+++ b/raw.c	Tue Sep 29 10:23:47 2009 +0000
@@ -628,8 +628,11 @@
             first_frames = frames;
     }
     if(codec_id != expected_codec_id) return 0;
-    if   (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;
-    else if(max_frames>=3) return AVPROBE_SCORE_MAX / 2;
+    // keep this in sync with mp3 probe, both need to avoid
+    // issues with MPEG-files!
+    if   (first_frames>=4) return AVPROBE_SCORE_MAX/2+1;
+    else if(max_frames>500)return AVPROBE_SCORE_MAX/2;
+    else if(max_frames>=4) return AVPROBE_SCORE_MAX/4;
     else if(max_frames>=1) return 1;
     else                   return 0;
 }