• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Don't waste bytes on BlockGroup length fields · 9f7e0b37
    Andreas Rheinhardt authored
    This commit uses the new EbmlWriter API to write the length fields
    of the BlockGroup and its descendants that are themselves Master
    elements (namely BlockAdditions and BlockMore) on the least amount of
    bytes.
    
    This fixes regressions introduced when the special code for writing
    general subtitles was removed. Accordingly, the binsub-mksenc and
    matroska-zero-length-block FATE-tests have now been reverted back
    to their old state again; the advantages of this approach are evident
    with the matroska-vp8-alpha-remux test which up until now wrote
    all the length fields of all BlockGroups, BlockAdditions and BlockMore
    on eight bytes.
    
    Using the EbmlWriter API also allowed to improve locality in
    mkv_write_block(): E.g. both DiscardPadding as well as the
    BlockAdditional side-data are now directly used to add elements
    to the writer whereas the earlier code had to first check
    for whether a BlockGroup should be used and then check again
    (after the place where a BlockGroup would be opened if one were
    used) for whether there is DiscardPadding or BlockAdditional
    side-data to write.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
    9f7e0b37
binsub-mksenc 33 Bytes