[Ffmpeg-devel] [PATCH] DVR-MS probe audio format - was DVR-MS bug (MP2 decoding)

John Donaghy johnfdonaghy
Fri Mar 16 03:56:52 CET 2007

> trying the same check everywhere in a buffer, lets say its 2kb large will
> cause 1 out of 50 random files to be misdetected as ac3, thats not going
> to
> work ...

OK, I see your point. I can think of three approaches then:

1) Improve the ac3_probe function which I think is probably the best way -
but unfortunately I've no idea how to do it.

2) In av_find_stream_info, call ac3_probe repeatedly after locating the
'sync word' and only mark the stream as ac3 if the probe function returns
enough positives. This assumes that an ac3 stream repeatedly contains the
pattern detected in the probe function.

3) Since the stream I'm trying to identify can only be MP2 or AC3 maybe I
could flag it initially as some newly defined value such as
'CODEC_DVR_AUDIO_UNKNOWN' and then in av_find_stream_info set the codec to
AC3 if it isnt MP2 after several frames have been read. The mp3_probe
function seems to work reliably for these streams.

Are any of these acceptable approaches,or can you suggest something else
that might do it?



More information about the ffmpeg-devel mailing list