• Chris Bass's avatar
    ttmlparse: Consolidate adjacent co-styled inline elements · acfaf3a0
    Chris Bass authored
    A common subtitling use case is live-generated subtitles, in which each
    new word is contained in its own span, and the spans are displayed
    sequentially, with the effect that lines of displayed subtitles are
    built up word-by-word.
    This can, however, cause problems when the number of words in a block is
    greater than the number of allowed GstMemorys in a GstBuffer.
    Since in this use case each span will have the same styling as adjacent
    spans, we can join adjacent spans (and other inline elements, such as
    breaks) into a single element containing the concatenated text of each,
    thus avoiding the limit of GstMemorys in a GstBuffer and also reducing
    the amount of styling/layout metadata that is attached to each buffer.
ttmlparse.c 58.7 KB