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

Michael Niedermayer michaelni
Wed May 19 21:38:04 CEST 2010


On Wed, May 19, 2010 at 03:27:22PM -0400, Ronald S. Bultje wrote:
> 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).

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

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100519/a4c1121e/attachment.pgp>



More information about the ffmpeg-devel mailing list