From 80b5fb6c7f1090a6c095e6418c491faa338fcf5a Mon Sep 17 00:00:00 2001 From: Jonathan Arndt Date: Tue, 15 Feb 2022 11:27:37 -0800 Subject: [PATCH] CiscoSparkCodec > Removed inner IF of processQueuedCommands and added CrestronInvoke to CheckSyncStatus --- .../PepperDashEssentialsBase/Queues/GenericQueue.cs | 2 +- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs index a1cef30d..8dca9803 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs @@ -118,7 +118,7 @@ namespace PepperDash.Essentials.Core.Queues /// public GenericQueue(string key, int pacing, Thread.eThreadPriority priority, int capacity) : this(key, priority, capacity, pacing) - { + { } /// diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index 1a9dec0e..edcc61ec 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -2529,12 +2529,9 @@ ConnectorID: {2}" { while (InitialSyncComplete) { - if (!_commandQueue.IsEmpty) - { - var query = _commandQueue.Dequeue(); + var query = _commandQueue.Dequeue(); - _parent.SendText(query); - } + _parent.SendText(query); } } @@ -2596,7 +2593,11 @@ ConnectorID: {2}" InitialSyncComplete = true; Debug.Console(1, this, "Initial Codec Sync Complete!"); Debug.Console(1, this, "{0} Command queued. Processing now...", _commandQueue.Count); - ProcessQueuedCommands(); + + // Invoke a thread for the queue + CrestronInvoke.BeginInvoke((o) => { + ProcessQueuedCommands(); + }); } else InitialSyncComplete = false;