From eda38a637e23b9ed3d626339dc1d112582115784 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 20 Jun 2023 00:33:56 +1000 Subject: [PATCH] fallbackswitch: Change the threshold for trailing buffers Only discard buffers on inactive pads if they are later than the current output running time, rather than the later timeout running time. That can mean switching to a higher priority pad can happen quicker. Part-of: --- utils/fallbackswitch/src/fallbackswitch/imp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index ee472c435..8c4b7f931 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -765,9 +765,9 @@ impl FallbackSwitch { start_running_time, state.upstream_latency + settings.latency, ) - } else if state.timeout_running_time.is_some() + } else if state.output_running_time.is_some() && end_running_time.map_or(false, |end_running_time| { - end_running_time < state.timeout_running_time.unwrap() + end_running_time < state.output_running_time.unwrap() }) { if raw_pad {