[FFmpeg-devel] [PATCH] Detect DTS in wav (issue70) + about ac3-in-wav
Anssi Hannula
anssi.hannula
Fri Jul 23 21:42:53 CEST 2010
Michael Niedermayer kirjoitti perjantai, 23. hein?kuuta 2010 21:29:38:
> On Fri, Jul 23, 2010 at 06:40:30AM +0300, Anssi Hannula wrote:
> > Anssi Hannula kirjoitti torstai, 22. hein?kuuta 2010 06:15:17:
> > > Hi!
> > >
> > > Attached are patches that fix issue70 (detection of DTS in wav).
> > >
> > > Two new fields are added to AVStream that allow demuxers to set a
> > > fallback codec to a stream, which gets used if no codec is probed in a
> > > defined number of bytes.
> > > Please comment if you think this should be done in some better way :)
> > >
> > > I made the wav demuxer do the probing only for PCM_S16LE, as all my
> > > dts/ac3- in-wav samples are like that. If people are aware of other
> > > kind of files, it could be changed to cover more/all PCM codecs if
> > > necessary.
> > >
> > >
> > > This works fine for DTS (issue70)
> >
> > The first patch added a warning (mixed code and declarations), attached
> > is a fixed one. The second patch was ok.
>
> i dont think this code will work reliable like this as the chances are
> pretty high that mp3 or ac3 will be detected in random data with a very
> low score
That won't happen, since set_codec_from_probe_data() gets called with score
AVPROBE_SCORE_MAX / 4 (i.e. any score <= AVPROBE_SCORE_MAX / 4 is ignored),
except in the very last iteration (st->probe_packet == 0), which we do not
actually reach due to s->probe_fallback_bytes.
--
Anssi Hannula
More information about the ffmpeg-devel
mailing list