cec: don't poll for a vendor ID in monitoring mode
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 7 Nov 2011 23:28:13 +0000 (00:28 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 7 Nov 2011 23:28:13 +0000 (00:28 +0100)
src/lib/CECProcessor.h
src/lib/devices/CECBusDevice.cpp

index ad444480ff1e3f5f6259b48e212ea84ab4a0e9d7..ef4c5195bdac933d9d3d5fc9816bf225afbe03b5 100644 (file)
@@ -56,6 +56,7 @@ namespace CEC
       virtual bool Start(void);
       virtual void *Process(void);
 
+      virtual bool                IsMonitoring(void) const { return m_bMonitor; }
       virtual cec_version         GetDeviceCecVersion(cec_logical_address iAddress);
       virtual bool                GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language);
       virtual const std::string & GetDeviceName(void) { return m_strDeviceName; }
index 9a33e0de1e4e67cb25537fda9d18103a3143ae62..64b084a7da24be73b037505c04d93d2ef288e4db 100644 (file)
@@ -88,7 +88,8 @@ void CCECBusDevice::PollVendorId(void)
   CLockObject lock(&m_mutex);
   if (m_iLastActive > 0 && m_iLogicalAddress != CECDEVICE_BROADCAST &&
       m_vendor.vendor == CEC_VENDOR_UNKNOWN &&
-      GetTimeMs() - m_iLastActive > 5000)
+      GetTimeMs() - m_iLastActive > 5000 &&
+      !m_processor->IsMonitoring())
   {
     m_iLastActive = GetTimeMs();