diff raw.c @ 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 9affc096944c
children 30c093f11b4e
line wrap: on
line diff
--- 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;
 }