[FFmpeg-soc] [soc]: r209 - matroska/matroskaenc.c

Michael Niedermayer michaelni at gmx.at
Sat Jun 2 12:26:06 CEST 2007


Hi

On Fri, Jun 01, 2007 at 06:46:13AM +0200, conrad wrote:
> Author: conrad
> Date: Fri Jun  1 06:46:13 2007
> New Revision: 209
> 
> Log:
> Beginning of mkv muxer, only EBML head is written correctly
[...]
> +    while (size >> (bytes*8 + 7-bytes) > 0) bytes++;

while (size >> (bytes*7 + 7)) bytes++;


[...]
> +// XXX: should we do any special checking for valid strings for these 2 functions?

i would say no, or put the checks in generic lavf code, duplicating string
validity checks in every muxer is silly ...


> +static void put_ebml_string(ByteIOContext *pb, unsigned int elementid, char *str)
> +{
> +    put_ebml_binary(pb, elementid, str, strlen(str));
> +}
> +
> +static void put_ebml_utf8(ByteIOContext *pb, unsigned int elementid, char *str)
> +{
> +    put_ebml_binary(pb, elementid, str, strlen(str));
> +}

also why not just call put_ebml_binary() for these 2 directly?


[...]
> +    ebml_header = start_ebml_master(pb, EBML_ID_HEADER);
> +    put_ebml_uint(pb, EBML_ID_EBMLVERSION, 1);
> +    put_ebml_uint(pb, EBML_ID_EBMLREADVERSION, 1);
> +    put_ebml_uint(pb, EBML_ID_EBMLMAXIDLENGTH, 4);
> +    put_ebml_uint(pb, EBML_ID_EBMLMAXSIZELENGTH, 8);
> +    put_ebml_string(pb, EBML_ID_DOCTYPE, "matroska");
> +    put_ebml_uint(pb, EBML_ID_DOCTYPEVERSION, 1);
> +    put_ebml_uint(pb, EBML_ID_DOCTYPEREADVERSION, 1);

they could be aligned for better readability like:


put_ebml_uint   (pb, EBML_ID_EBMLVERSION        ,           1);
put_ebml_uint   (pb, EBML_ID_EBMLREADVERSION    ,           1);
put_ebml_uint   (pb, EBML_ID_EBMLMAXIDLENGTH    ,           4);
put_ebml_uint   (pb, EBML_ID_EBMLMAXSIZELENGTH  ,           8);
put_ebml_string (pb, EBML_ID_DOCTYPE            ,  "matroska");
put_ebml_uint   (pb, EBML_ID_DOCTYPEVERSION     ,           1);
put_ebml_uint   (pb, EBML_ID_DOCTYPEREADVERSION ,           1);


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20070602/2a7f1a4e/attachment.pgp>


More information about the FFmpeg-soc mailing list