From 68b85504e87c0ef24accee313dd4b1c7018eb60e Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 29 Sep 2009 10:23:47 +0000 Subject: [PATCH] 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. git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20075 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- libavformat/mp3.c | 2 ++ libavformat/raw.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libavformat/mp3.c b/libavformat/mp3.c index 42ca42fa08..01248742e0 100644 --- a/libavformat/mp3.c +++ b/libavformat/mp3.c @@ -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; diff --git a/libavformat/raw.c b/libavformat/raw.c index f807a96f31..e7cfd7c1d0 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -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; } -- 2.11.4.GIT