From: Lars Op den Kamp Date: Fri, 25 Nov 2011 11:43:16 +0000 (+0100) Subject: cec: update m_iLastActive if a poll was acked in CCECBusDevice::TransmitPoll() X-Git-Tag: upstream/2.2.0~1^2~44^2~100 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1674de3796d7c1ae6a3aa600b5194c426dfa7e47;p=deb_libcec.git cec: update m_iLastActive if a poll was acked in CCECBusDevice::TransmitPoll() --- diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 689ff87..c241ed7 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -652,10 +652,20 @@ bool CCECBusDevice::TransmitPoll(cec_logical_address dest) cec_command command; cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_NONE); - CLockObject lock(&m_transmitMutex); - bReturn = m_processor->Transmit(command); + { + CLockObject lock(&m_transmitMutex); + bReturn = m_processor->Transmit(command); + } + AddLog(CEC_LOG_DEBUG, bReturn ? ">> POLL sent" : ">> POLL not sent"); + + if (bReturn) + { + CLockObject lock(&m_mutex); + m_iLastActive = GetTimeMs(); + } + return bReturn; }