cec: clean up lib/platform
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 18f685844b20ab847fbab2fe2a0e5c9a2fada7f2..331315d77e7870f6a9e46a9058c5773dc166c5fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
@@ -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)) == true)
       {
         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;