From: Lars Op den Kamp Date: Thu, 26 Apr 2012 10:36:13 +0000 (+0200) Subject: cec: signal waiting threads when receiving a feature abort too X-Git-Tag: upstream/2.2.0~1^2~29^2^2~33 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b499cf168f02996ba54f580b515433e3eab25a52;p=deb_libcec.git cec: signal waiting threads when receiving a feature abort too --- 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);