[matroska-devel] Reference change

Steve Lhomme steve.lhomme at free.fr
Mon Feb 17 15:59:28 CET 2003


I was thinking about the way I'm currently handling references in libmatroska. I
have some problems with the cueing fields, because it requires the position of
the Cluster that is not known inside the Block. For references, we also need the
position of the Cluster and the timecode of the referenced Block.

The current situation is that for cueing data I give a Block and referenced
timecodes. But I'm still missing the position of the Cluster...

What I'm planning to do is :
- add a reference/pointer to the parent Cluster for each Block
- for each reference (KaxReferenceBlock ?) a reference/pointer to the
corresponding Block should be available (to be able to recover the timecode of
the reference and the parent Cluster (see above)).

So expect some changes in the API with these changes, the old way of setting a
references might be removed, since it can lead to bugs (put a non existent
timecode as reference). It will also make mandatory the use of coding order (you
can't reference a Block that doesn't exist).

There might be a problem when references are spanned across Clusters, because we
don't want to cache all old Blocks with large data. So we have 2 options (at
least) :
- free the data after the Block has been written to the stream (on request) and
just keep the internal data (like the Block position, timecode, parent Cluster,
- copy the Block internal data (like the Block position, timecode, parent
Cluster, etc) into a special Block that doesn't contain any data, and do
whatever you want with the original Block.

Any comments on the changes ? (I'll work on that tonight)

After this part is done, I'll start working on FileKax (and maybe first fix the
known bugs in some EBML/matroska parts).

More information about the Matroska-devel mailing list