cec: wait 500 ms before trying to retransmit a command. always wait for the result...
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 66bdfbd10b509f150df19d8a648024519c08767d..5fe3ebae6156aabd4c35812e882dffff33431e44 100644 (file)
@@ -959,12 +959,11 @@ bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /*
     while (!bReturn && ++iTries <= iMaxTries)
     {
       m_expectedResponse = expectedResponse;
-      if (m_processor->Transmit(command))
+      if ((bReturn = m_processor->Transmit(command)))
       {
         CLibCEC::AddLog(CEC_LOG_DEBUG, "command transmitted");
-        bReturn = bExpectResponse ?
-            m_condition.Wait(m_receiveMutex, m_iTransmitWait) :
-            true;
+        if (bExpectResponse)
+          bReturn = m_condition.Wait(m_receiveMutex, m_iTransmitWait);
       }
     }
     --m_iUseCounter;