From: Lars Op den Kamp Date: Sat, 29 Oct 2011 15:26:29 +0000 (+0200) Subject: cec: simplified WaitForAck() call. no longer needs to be in a while loop X-Git-Tag: upstream/2.2.0~1^2~187 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;ds=sidebyside;h=3f9b82aa7229403771e0b5d33087e75084631891;p=deb_libcec.git cec: simplified WaitForAck() call. no longer needs to be in a while loop --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index c73c02d..b5cd540 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -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