From b499cf168f02996ba54f580b515433e3eab25a52 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 26 Apr 2012 12:36:13 +0200 Subject: [PATCH] cec: signal waiting threads when receiving a feature abort too --- src/lib/devices/CECBusDevice.cpp | 13 ++++++++++--- src/lib/implementations/CECCommandHandler.cpp | 5 +++++ src/lib/implementations/CECCommandHandler.h | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 51ddfec..8a9f963 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -1038,9 +1038,16 @@ bool CCECBusDevice::IsUnsupportedFeature(cec_opcode opcode) void CCECBusDevice::SetUnsupportedFeature(cec_opcode opcode) { - CLockObject lock(m_mutex); - CLibCEC::AddLog(CEC_LOG_DEBUG, "marking opcode '%s' as unsupported feature for device '%s'", ToString(opcode), GetLogicalAddressName()); - m_unsupportedFeatures.insert(opcode); + { + CLockObject lock(m_mutex); + CLibCEC::AddLog(CEC_LOG_DEBUG, "marking opcode '%s' as unsupported feature for device '%s'", ToString(opcode), GetLogicalAddressName()); + m_unsupportedFeatures.insert(opcode); + } + + // signal threads that are waiting for a reponse + MarkBusy(); + m_handler->SignalOpcode(cec_command::GetResponseOpcode(opcode)); + MarkReady(); } bool CCECBusDevice::ActivateSource(void) diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index faefaf9..2d3fbe0 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -1047,3 +1047,8 @@ bool CCECCommandHandler::ActivateSource(void) } return true; } + +void CCECCommandHandler::SignalOpcode(cec_opcode opcode) +{ + m_waitForResponse->Received(opcode); +} diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index fe9a3f1..d7f6300 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -159,6 +159,8 @@ namespace CEC virtual bool SendDeckStatusUpdateOnActiveSource(void) const { return m_bOPTSendDeckStatusUpdateOnActiveSource; }; virtual bool TransmitPendingActiveSourceCommands(void) { return true; } + virtual void SignalOpcode(cec_opcode opcode); + protected: virtual bool HandleActiveSource(const cec_command &command); virtual bool HandleDeckControl(const cec_command &command); -- 2.34.1