• Martin Storsjö's avatar
    movenc: Allow setting start_dts/start_cts before writing actual packets · bef3b1f5
    Martin Storsjö authored
    By writing a zero-sized packet, the caller can communicate the
    start_dts/start_cts for the stream without actually writing
    the first packet.
    
    This allows doing random-access writing of fragments when the
    start dts of the stream isn't zero, so that the edit list in the moov
    is written based on timestamps from the nominal start time signaled
    via the zero-sized packet, while the first proper packet written
    corresponds to a later fragment.
    
    To avoid potential unexpected behaviour, empty packets only set
    start_dts if the frag_discont flag is set.
    Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
    bef3b1f5
movenc.c 157 KB