-
Tim-Philipp Müller authored
When we feed the elementary streams directly to hardware decoders' ES buffers, the amount of space for each ES stream is usually limited. When A/V interleaving is bad, that easily leads to lock-ups because one of the ES buffers (usually the video buffer) fills up, while the audio buffer is still empty or low, which leads to stuttering playback in the best case, or deadlocks (e.g. no preroll after seeking) in the worst case. Detect bad A/V interleaving and stop processing streams that run ahead, until we've caught up on the lagging streams, then jump back, and process the packets from the other stream which we've skipped. Needs more work and testing, also should be made configurable e.g. via a property.
ca0de588