always poll the TV if it's marked as not present. issue #83. issue #84
authorLars Op den Kamp <lars@opdenkamp.eu>
Fri, 9 Nov 2012 15:32:55 +0000 (16:32 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Fri, 9 Nov 2012 15:32:55 +0000 (16:32 +0100)
src/lib/devices/CECBusDevice.cpp

index 5fe6d4dd26ee0060267dfd90880b2ad123a00947..1176089b57200081974880329531e01f1ee14380 100644 (file)
@@ -740,8 +740,13 @@ cec_bus_device_status CCECBusDevice::GetStatus(bool bForcePoll /* = false */, bo
     CLockObject lock(m_mutex);
     status = m_deviceStatus;
     bNeedsPoll = !bSuppressPoll &&
-        (bForcePoll || m_deviceStatus == CEC_DEVICE_STATUS_UNKNOWN) &&
-        m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC;
+        m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC &&
+            // poll forced
+            (bForcePoll ||
+            // don't know the status
+            m_deviceStatus == CEC_DEVICE_STATUS_UNKNOWN ||
+            // always poll the TV if it's marked as not present
+            (m_deviceStatus == CEC_DEVICE_STATUS_NOT_PRESENT && m_iLogicalAddress == CECDEVICE_TV));
   }
 
   if (bNeedsPoll)