mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
feat: update debounce timer logic to handle multiple input ports for a single sink
This commit is contained in:
parent
4ab4ee1680
commit
94837a60cf
1 changed files with 8 additions and 2 deletions
|
|
@ -279,9 +279,15 @@ namespace PepperDash.Essentials.Core.Routing
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var key = destination.Key;
|
// Keyed by destination AND input port, not just destination: a single sink can have
|
||||||
|
// several independently-routed input ports (e.g. a codec with multiple simultaneous
|
||||||
|
// USB camera inputs, all downstream of the same midpoint). Keying by destination alone
|
||||||
|
// meant updates for one port would cancel/replace the still-pending debounce timer for
|
||||||
|
// a sibling port on the same sink, so only the last-processed port's update ever
|
||||||
|
// actually ran - the others silently never got refreshed.
|
||||||
|
var key = destination.Key + ":" + (inputPort?.Key ?? string.Empty);
|
||||||
|
|
||||||
// Cancel existing timer for this sink
|
// Cancel existing timer for this specific sink/port combination
|
||||||
if (updateTimers.TryGetValue(key, out var existingTimer))
|
if (updateTimers.TryGetValue(key, out var existingTimer))
|
||||||
{
|
{
|
||||||
existingTimer.Stop();
|
existingTimer.Stop();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue