[FFmpeg-devel] [PATCH]Improce auto-detection for cdata files
Wed Dec 30 22:54:39 CET 2009
Reimar D?ffinger wrote:
> On Wed, Dec 30, 2009 at 08:14:49PM +0000, Carl Eugen Hoyos wrote:
>> Reimar D?ffinger <Reimar.Doeffinger <at> gmx.de> writes:
>>>> - if (b == 0x04 && (b == 0x00 || b == 0x04 || b == 0x0C))
>>>> + if (b == 0x04 && (b == 0x00 || b == 0x04 || b == 0x0C) &&
>>>> + ((uint32_t *)b) == ((uint32_t *)b) && ((uint32_t *)b))
>>>> return AVPROBE_SCORE_MAX/8;
>>> You should check for a valid sample_rate
>> I totally agree.
>> What are valid sample rates?
> Well, at least != 0. And that check actually should be done in the
> read_header as well since we can get a division by 0 otherwise I think.
> Otherwise I'd suggest to consider < 4000 as valid (since it is only 16
> bit, I wouldn't check for a maximum).
Check out the idcin demuxer where I had to do something similar. I
bounded the sample rate between 8000..48000 Hz. Sure, sample rates could
theoretically go much higher in modern practice (96, 192 KHz), but in
these old DOS games, unlikely.
More information about the ffmpeg-devel