[Matroska-devel] libmatroska's copy c'tors

Moritz Bunkus moritz at bunkus.org
Wed Jan 14 17:59:11 CET 2004


Heya,

(This goes out to robux mostly.)

I'm in the process of implementing a general 'just copy the stream'
functionality for track types mkvmerge doesn't know anything about and
came about this problem: Due to default values not being written and
mandatory elements I can't just Render() an element I've just
read. Example: Content encodings:

  + Content encodings
   + Content encoding
    + Content compression

This is what content encoding looks like for zlib compression. Now, some
of ContentCompression's children are missing because they're set to
their default value, BUT they're mandatory as well.

What I'm doing then is something like
  KaxContentEncodings *copy = new KaxContentEncodings(*old_encodings);
  copy->Render(*out);

And sure as hell I get an assertion about the mandatory elements
missing. So could you please think about a way to avoid this? I think
that you could modify the copy c'tor so that after the copy it'll
iterate over all the children and create the mandatory elements if
they're missing. This has to be done recursively for EbmlMaster
children, of course.

Thanks.

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds



More information about the Matroska-devel mailing list