You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: audio pump starvation on large files with audio (#1041)
Root causes fixed:
1. Remove starvation check that suspends AudioContext — it freezes the
video clock and causes playback to stall permanently
2. Add backpressure (1s BUFFER_AHEAD) to prevent audio pump from decoding
unbounded buffers, starving the video decoder
3. Add setTimeout(0) yield between batches so video rAF callbacks can run
4. Batch audio buffer reads (16 per iteration) to reduce IPC overhead
5. Fix latestScheduledEndTime time-domain: use media-time (same domain as
currentTime) instead of AudioContext-time, so backpressure check works
correctly after seeking
Without these fixes, playing a large file (9+ GB) with audio causes:
- Audio pump decodes hundreds of buffers in 1 second (195s of audio decoded
in 1s wall clock)
- Main thread blocked by 177 IPC calls/sec from audio iterator
- Video frames never render (rAF starved)
- After seek: backpressure never triggers due to time-domain mismatch,
causing persistent stutter and eventual silence
0 commit comments