cec: signal waiting threads when receiving a feature abort too
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 26 Apr 2012 10:36:13 +0000 (12:36 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 26 Apr 2012 10:36:13 +0000 (12:36 +0200)
src/lib/devices/CECBusDevice.cpp
src/lib/implementations/CECCommandHandler.cpp
src/lib/implementations/CECCommandHandler.h

index 51ddfeca68af118baca2ed31bda586c1d0921cee..8a9f963c0a419dda6d233ec12573702280454bf4 100644 (file)
@@ -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)
index faefaf967248db9cf51b2baee7143f0fa2a2d4b0..2d3fbe0af29376e5ad5500b09f29d87583f9bbac 100644 (file)
@@ -1047,3 +1047,8 @@ bool CCECCommandHandler::ActivateSource(void)
   }
   return true;
 }
+
+void CCECCommandHandler::SignalOpcode(cec_opcode opcode)
+{
+  m_waitForResponse->Received(opcode);
+}
index fe9a3f1be191aa9b1de930f91bcdde9d76537604..d7f630031a38b70fecc9973703733ca5fddfa47b 100644 (file)
@@ -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);