From: Lars Op den Kamp Date: Thu, 22 Mar 2012 10:44:04 +0000 (+0100) Subject: cec: update m_iLineTimeout correctly in CUSBCECAdapterCommunication::SetLineTimeout() X-Git-Tag: upstream/2.2.0~1^2~31^2~59 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=16459df9cd101434227ffc8467e3a8bd6979a6c8;p=deb_libcec.git cec: update m_iLineTimeout correctly in CUSBCECAdapterCommunication::SetLineTimeout() --- diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index 49bd9ea..e092274 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -487,15 +487,16 @@ uint16_t CUSBCECAdapterCommunication::GetFirmwareVersion(void) bool CUSBCECAdapterCommunication::SetLineTimeout(uint8_t iTimeout) { - m_iLineTimeout = iTimeout; - bool bReturn(m_iLineTimeout != iTimeout); + bool bReturn(true); - if (!bReturn) + if (m_iLineTimeout != iTimeout) { CLibCEC::AddLog(CEC_LOG_DEBUG, "setting the line timeout to %d", iTimeout); CCECAdapterMessage params; params.PushEscaped(iTimeout); bReturn = SendCommand(MSGCODE_TRANSMIT_IDLETIME, params); + if (bReturn) + m_iLineTimeout = iTimeout; } return bReturn;