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

Ronald S. Bultje rsbultje
Wed May 19 21:27:22 CEST 2010


Hi,

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).

Right now it would work, yes.

Ronald



More information about the ffmpeg-devel mailing list