Sync AC3 probe values with MP3 probe values, they have to avoid similar issues.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 29 Sep 2009 10:23:47 +0000 (10:23 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 29 Sep 2009 10:23:47 +0000 (10:23 +0000)
This fixes ffmpeg-generated files with -acodec ac3 being detected as raw ac3
instead of MPEG.

Originally committed as revision 20075 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mp3.c
libavformat/raw.c

index 42ca42f..0124874 100644 (file)
@@ -63,6 +63,8 @@ static int mp3_read_probe(AVProbeData *p)
         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;
index f807a96..e7cfd7c 100644 (file)
@@ -628,8 +628,11 @@ static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
             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;
 }