[FFmpeg-cvslog] r20075 - in trunk/libavformat: mp3.c raw.c

Justin Ruggles justin.ruggles
Tue Sep 29 23:12:25 CEST 2009


reimar wrote:

> Author: reimar
> Date: Tue Sep 29 12:23:47 2009
> New Revision: 20075
> 
> Log:
> 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.
> 
> Modified:
>    trunk/libavformat/mp3.c
>    trunk/libavformat/raw.c
> 
> Modified: trunk/libavformat/mp3.c
> ==============================================================================
> --- trunk/libavformat/mp3.c	Tue Sep 29 12:12:18 2009	(r20074)
> +++ trunk/libavformat/mp3.c	Tue Sep 29 12:23:47 2009	(r20075)
> @@ -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;
> 
> Modified: trunk/libavformat/raw.c
> ==============================================================================
> --- trunk/libavformat/raw.c	Tue Sep 29 12:12:18 2009	(r20074)
> +++ trunk/libavformat/raw.c	Tue Sep 29 12:23:47 2009	(r20075)
> @@ -628,8 +628,11 @@ static int ac3_eac3_probe(AVProbeData *p
>              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;
>  }

I'm worried this is too weak for AC-3.  I had problems in the past with
valid AC-3 files not being detected as such due to the probe size being
too small to fit enough frames.  But much has changed with probe scores
since then so we'll see what happens.

-Justin



More information about the ffmpeg-cvslog mailing list