From: Lars Op den Kamp Date: Thu, 8 Mar 2012 19:21:42 +0000 (+0100) Subject: cec: only wait for multiple 'command accepted' response when sending a transmit comma... X-Git-Tag: upstream/2.2.0~1^2~31^2~90 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=99f1d66e089d70a3cd460292eb521686181af0e6;p=deb_libcec.git cec: only wait for multiple 'command accepted' response when sending a transmit command, and only to 1 in other cases. bugzid: 543 --- diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index 030d643..20f480b 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -823,7 +823,7 @@ bool CUSBCECAdapterCommunication::WaitForAck(CCECAdapterMessage &message) { bool bError(false); bool bTransmitSucceeded(false); - uint8_t iPacketsLeft(message.Size() / 4); + uint8_t iPacketsLeft(message.isTransmission ? message.Size() / 4 : 1); int64_t iNow = GetTimeMs(); int64_t iTargetTime = iNow + (message.transmit_timeout <= 5 ? CEC_DEFAULT_TRANSMIT_WAIT : message.transmit_timeout);