[FFmpeg-devel] [PATCH] MTH demuxer (Gamecube format)
Michael Montanye
montanye
Tue Feb 3 20:58:28 CET 2009
Vitor Sessak wrote:
[...]
>> +static int mth_probe(AVProbeData *p)
>> +{
>> + /* check file header */
>> + if (AV_RL32(p->buf) == MKTAG('M', 'T', 'H', 'P'))
>> + return AVPROBE_SCORE_MAX;
>> + else
>> + return 0;
>> +}
>>
>
> This is a little false-positive prone (just four bytes). Something like
> the following is better
>
> if (AV_RL32(p->buf) != MKTAG('M', 'T', 'H', 'P'))
> return 0;
>
> if ({fps, width and weight are sane})
> return AVPROBE_SCORE_MAX;
> else
> return AVPROBE_SCORE_MAX/3;
>
Several other game-related formats already use this same four-byte
check, including the THP demuxer this was based on, so I'm not sure this
is that big a concern. (bethsoftvid, segafilm, smacker, and wc3movie
also have the same or similar checks, and there may be others I missed
on the first pass)
[...]
> Is there any reason to stop before EOF? If not, them you also don't need
> all the frame counting logic...
>
Okay, that was mostly carryover from the THP demuxer, so it's all removed.
> -Vitor
>
The other fixes have been incorporated, and Diego's fixes are also
added, new patch attached.
-Michael Montanye
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mth-demuxer2.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090203/bdfc8673/attachment.asc>
More information about the ffmpeg-devel
mailing list