The decode head lagged the player by a constant ε (ffmpeg startup latency) because ffmpeg paced at -readrate <speed> started behind mpv and, advancing at the same rate, never caught up — bars were a few seconds behind for the entire playback. Add -readrate_initial_burst LEAD_SECONDS so ffmpeg emits 3s of audio immediately on start, then paces at realtime after. The decode head leads the player by a stable ~3s from the very first frame; read() samples at the exact player position and always finds fresh samples. Add a sustained render-loop test that simulates ~5s of real playback, asserting ffmpeg stays alive, the decode head maintains a positive lead, and read() returns full windows. Uses real wall-clock time (documented exception) since ffmpeg's decode pacing can't be tested deterministically.
8.1 KiB
8.1 KiB