[Matroska-devel] libmatroska - AddFrame lacks default lacing type

Steve Lhomme steve.lhomme at free.fr
Fri Oct 31 14:03:07 CET 2003

Moritz Bunkus wrote:

> Hi.
>>In some cases it's better not to put default value. I think it's better 
>>to put it in "helper" functions that a dumb user will use (like 
>>EbmlMaster::Read()) but not in low functions. For example I didn't put a 
>>value on purpose for EbmlBinary. (at first I didn't want to put it 
>>anywhere, but it doesn't make sense to check an integer without the
> Ok, for EbmlMaster/EbmlBinary it wasn't really needed, that was too fast
> a reaction of mine. But KaxBlock.h should get it (API compatibility) as
> it just keeps the behaviour consistent to earlier versions.
> So we can remove the defaults for the two Ebml* again for the next
> release.


BTW, not that I think of it, it *does* make sense to have 
ReadFully=false for an integer. Because in EbmlMaster::Read() it would 
read the ID+length and leave the value behind. Which is nice if you 
really don't want to read values and just the data structure.

But that also means in your case (reading a Cluster without the Block 
data only) using ReadFully=false would read nothing, just the structure. 
So IMO ReadFully should be moved from an integer to a bitfield. With 
values like :

0 Read no data (no integer content)
1 Read all data
2 Read partial data (ie integers OK, but not Block data)

Only the handling of the '2' value needs to be added (in 
libebml+libmatroska), the rest is backward compatible.

More information about the Matroska-devel mailing list