[FFmpeg-devel] [PATCH] Stricter TMV probe

Reimar Döffinger Reimar.Doeffinger
Mon Sep 14 22:33:33 CEST 2009


On Mon, Sep 14, 2009 at 04:25:23PM -0400, Ronald S. Bultje wrote:
> On Mon, Sep 14, 2009 at 4:22 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
> > if(samplerate < 1000 || samplerate > 192000)
> > ? ?return 0;
> >
> > switch (samplerate) {
> > case 8000:
> > case 11025:
> > case 22050:
> > case 44100:
> > case 48000:
> > ? ?// all known samplerates for the format
> > ? ?return AVPROBE_SCORE_MAX;
> > default:
> > ? ?return AVPROBE_SCORE_MAX / 4; // who knows?
> 
> Agree; and in fact, if we do, might want to doc it somewhere or write
> a wrapper, else we'll get inconsistencies and typo bugs.

Maybe, though probe functions can be made arbitrarily complex up to
actually encoding, the question is up to where it makes sense.
A generic function is a good idea that might make it reasonable to use
it, but someone will still have to come up with something that can be
conveniently used in all cases (the maximum might not always be
AVPROBE_SCORE_MAX, it also will certainly depend on other checks,
it might even be convenient to just run additional tests _after_
handling the sample rate).



More information about the ffmpeg-devel mailing list