From 315ff809364552f6faee215b56ecacb2efaea8e4 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Tue, 8 Nov 2011 00:28:13 +0100 Subject: [PATCH] cec: don't poll for a vendor ID in monitoring mode --- src/lib/CECProcessor.h | 1 + src/lib/devices/CECBusDevice.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.34.1