From: Lars Op den Kamp Date: Mon, 7 Nov 2011 23:28:13 +0000 (+0100) Subject: cec: don't poll for a vendor ID in monitoring mode X-Git-Tag: upstream/2.2.0~1^2~91 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=315ff809364552f6faee215b56ecacb2efaea8e4;p=deb_libcec.git cec: don't poll for a vendor ID in monitoring mode --- diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index ad44448..ef4c519 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -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; } diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 9a33e0d..64b084a 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -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();