cec: simplified WaitForAck() call. no longer needs to be in a while loop
authorLars Op den Kamp <lars@opdenkamp.eu>
Sat, 29 Oct 2011 15:26:29 +0000 (17:26 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sat, 29 Oct 2011 15:26:29 +0000 (17:26 +0200)
src/lib/CECProcessor.cpp

index c73c02d21748f324ce105ae134ee7f830a48376c..b5cd540fb9135d26a1685a47f3c20406e87a41d8 100644 (file)
@@ -189,17 +189,8 @@ bool CCECProcessor::Transmit(const cec_command &data, bool bWaitForAck /* = true
 
   if (bWaitForAck)
   {
-    uint64_t now = GetTimeMs();
-    uint64_t target = now + 1000;
     bool bError(false);
-
-    while (!bReturn && now < target && !bError)
-    {
-      bReturn = WaitForAck(&bError, output.size(), (uint32_t) (target - now));
-      now = GetTimeMs();
-    }
-
-    if (!bReturn)
+    if ((bReturn = WaitForAck(&bError, output.size(), 1000)) == false)
       m_controller->AddLog(CEC_LOG_ERROR, "did not receive ack");
   }
   else