Skip to content
  • Jan Schmidt's avatar
    isomp4: Implement robust muxing using ping-pong strategy · 1d058c7d
    Jan Schmidt authored
    Implement a robust recording mode, where the output
    file is always in a playable state, seeking and rewriting
    the moov header at a configurable interval. Rewriting
    moov is done using reserved space at the start of
    the file, and a ping-pong strategy where the moov
    is replaced atomically so it's never invalid.
    
    Track when tags have actually changed, and don't write them into
    the moov unless they've changed. Clear any existing tags when
    re-writing them, so we can do progressive moov updating in robust
    recording mode.
    
    Write placeholder mdat as a free atom plus a 32-bit mdat
    with '0' size, which means "rest of the file" in the spec.
    
    Re-write it later to a full 64-bit extended size atom if needed.
    1d058c7d