[FFmpeg-devel] [PATCH] WebM mux/demux

David Conrad lessen42
Wed May 19 23:10:32 CEST 2010


On May 19, 2010, at 3:47 PM, Michael Niedermayer wrote:

> On Wed, May 19, 2010 at 03:42:12PM -0400, Ronald S. Bultje wrote:
>> Hi,
>> 
>> On Wed, May 19, 2010 at 3:38 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>>> On Wed, May 19, 2010 at 03:27:22PM -0400, Ronald S. Bultje wrote:
>>>> On Wed, May 19, 2010 at 3:14 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>>>>> On Wed, May 19, 2010 at 03:05:30PM -0400, David Conrad wrote:
>>>>>> -    /* The header must contain the document type 'matroska'. For now,
>>>>>> +    /* The header must contain a known document type. For now,
>>>>>>       * we don't parse the whole header but simply check for the
>>>>>>       * availability of that array of characters inside the header.
>>>>>>       * Not fully fool-proof, but good enough. */
>>>>>> -    for (n = 4+size; n <= 4+size+total-(sizeof(probe_data)-1); n++)
>>>>>> -        if (!memcmp(p->buf+n, probe_data, sizeof(probe_data)-1))
>>>>>> -            return AVPROBE_SCORE_MAX;
>>>>>> +    for (i = 0; i < FF_ARRAY_ELEMS(matroska_doctypes); i++)
>>>>>> +        for (n = 4+size; n <= 4+size+total-(strlen(matroska_doctypes[i])-1); n++)
>>>>>> +            if (!memcmp(p->buf+n, probe_data, strlen(matroska_doctypes[i])-1))
>>>>>> +                return AVPROBE_SCORE_MAX;
>>>>>> 
>>>>>>      return 0;
>>>>>>  }
>>>>> 
>>>>> it would be more future proof if we didnt check this string at all (as long
>>>>> as reliable detection is still possible of course)
>>>> 
>>>> That would fail if someone creates an EMBL-based, but
>>>> matroska-incompatible format (e.g. matroska2).
>>> 
>>> such format would fail with svn, with my suggestion and with any of
>>> the patches posted. So no real difference except that with my suggestion
>>> it would be detected as matroska while the others might detect it as
>>> ac3 or mp3 with low score
>> 
>> True, I was thinking though that you'd prefer to decrease false
>> positives, not add to it... But either way is fine with me of course.
> 
> we could print a "warning unknown doctype blah blah this might fail"
> 
> and false positive it is only if we have a matroska2 demuxer implemented
> completely seperately otherwise detecting it as matroska is more correct.

Like so?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: textmate stdin O2LWmN.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100519/4ee68fab/attachment.txt>



More information about the ffmpeg-devel mailing list