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

Ronald S. Bultje rsbultje
Wed May 19 21:42:12 CEST 2010


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.

Ronald



More information about the ffmpeg-devel mailing list