• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Don't waste bytes writing durations · bd7dea3f
    Andreas Rheinhardt authored
    Tags in the Matroska file format can be summarized as follows: There is
    a level 1-element called Tags containing one or many Tag elements each
    of which in turn contain a Targets element and one or many SimpleTags.
    Each SimpleTag roughly corresponds to a single key-value pair similar to
    an AVDictionaryEntry. The Targets meanwhile contains information to what
    the metadata contained in the SimpleTags contained in the containing Tag
    applies (i.e. to the file as a whole or to an individual track).
    
    The Matroska muxer writes such metadata. It puts the metadata of every
    stream into a Tag whose Targets makes it point to the corresponding
    track. And if the output is seekable, then it also adds another Tag for
    each track whose Targets corresponds to the track and where it reserves
    space in a SimpleTag to write the duration at the end of the muxing
    process into.
    
    Yet there is no reason to write two Tag elements for a track and a few
    bytes (typically 24 bytes per track) can be saved by adding the duration
    SimpleTag to the other Tag of the same track (if it exists).
    
    FATE has been updated because the output files changed. (Tests that
    write to unseekable output (pipes) needn't be updated (no duration tag
    has ever been written for them) and the same applies to tests without
    further metadata.)
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    bd7dea3f
mkv 131 Bytes