mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-07 05:12:22 -04:00
libobs: Allow interleaver to recover from temporary stalls
The interleaver requires packets with sufficiently high timestamps from all encoders to be available to send out before it outputs a packet. This means that if one encoder stalls and does not submit packets for a while the interleaver can end up with a permanent increase to its delay due to multiple packets being received from the other encoders without being able to send any. This change introduces a recovery mechanism that relies on an upper bound for the amount of packets that may become "streamable" at a time being calculated, and flushing additional packets if that bound is violated. The upper bound is based on the largest expected interval between packets and how many packets for each encoder could arrive within double that interval (to give us a bit of wiggle room since not all encoders will deliver frames 100% consistently). This ensures that we still send data at a steady rate but allow the buffer to drain if it becomes larger than it needs to be.
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f