diff --git a/native/opennow-streamer/crates/opennow-streamer-core/src/lib.rs b/native/opennow-streamer/crates/opennow-streamer-core/src/lib.rs index 446322e6a..36a131546 100644 --- a/native/opennow-streamer/crates/opennow-streamer-core/src/lib.rs +++ b/native/opennow-streamer/crates/opennow-streamer-core/src/lib.rs @@ -128,7 +128,11 @@ enum State { Connected, } -const ENCODED_MEDIA_QUEUE_CAPACITY: usize = 8; +/// When a lost packet is retransmitted, the reorder queue releases every frame it held behind +/// the gap at once: up to 52 ms of video, 7 frames at 120 fps or 13 at 240, and more when +/// several waits overlap. A frame that does not fit is dropped and costs a keyframe, so leave +/// room for such a release. +const ENCODED_MEDIA_QUEUE_CAPACITY: usize = 32; const NVST_RECOVERY_ATTEMPT_LIMIT: usize = 1; const NATIVE_INPUT_POLL_INTERVAL: Duration = Duration::from_micros(250); const MAX_STREAM_FPS: u32 = 360; diff --git a/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/session.rs b/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/session.rs index 6529b9153..9617a3da3 100644 --- a/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/session.rs +++ b/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/session.rs @@ -103,8 +103,9 @@ impl SessionConfig { // retires a large frame or reallocates surfaces. Four frames is // too small for a 120 Hz stream and turns a harmless burst into a // decoder reset. Keep this bounded, but absorb roughly two frame - // batches before initiating keyframe recovery. - encoded_queue_depth: 16, + // batches before initiating keyframe recovery. A repaired network gap + // releases every frame held behind it at once (13 at 240 fps). + encoded_queue_depth: 32, decoded_queue_depth: 3, audio: Some(AudioConfig::default()), }