cec: set a message state in CCECAdapterMessage and check this state after sending...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 350958f41d1b1f9342d53731d6c1062d0bb1c934..1bc4c597854ad6475dc6557a67429445fa5a1813 100644 (file)
@@ -200,7 +200,14 @@ bool CCECProcessor::Transmit(const cec_command &data, bool bWaitForAck /* = true
     if (!m_communication || !m_communication->Write(output))
       return bReturn;
     else
+    {
       output->condition.Wait(&output->mutex);
+      if (output->state != ADAPTER_MESSAGE_STATE_SENT)
+      {
+        m_controller->AddLog(CEC_LOG_ERROR, "command was not sent");
+        return bReturn;
+      }
+    }
   }
 
   if (bWaitForAck)