cec: update m_iLastActive if a poll was acked in CCECBusDevice::TransmitPoll()
authorLars Op den Kamp <lars@opdenkamp.eu>
Fri, 25 Nov 2011 11:43:16 +0000 (12:43 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Fri, 25 Nov 2011 11:43:16 +0000 (12:43 +0100)
src/lib/devices/CECBusDevice.cpp

index 689ff870b8e1d8a73cdeda66e3d847d145f3d1f0..c241ed766aca4aafe94db80e6ce7fa4151762ca0 100644 (file)
@@ -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;
 }