From 2813bd07868a69271858aaa5ddda786d8488fffc Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 25 Nov 2011 12:48:26 +0100 Subject: [PATCH] cec: don't scan the whole bus in CCECProcessor::IsActiveDeviceType() --- src/lib/CECProcessor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 17e9fcb..e43d298 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -668,10 +668,12 @@ bool CCECProcessor::IsActiveDevice(cec_logical_address address) bool CCECProcessor::IsActiveDeviceType(cec_device_type type) { - cec_logical_addresses activeDevices = GetActiveDevices(); for (unsigned int iPtr = 0; iPtr < 15; iPtr++) - if (activeDevices.IsSet((cec_logical_address) iPtr) && m_busDevices[iPtr]->GetType() == type) + { + if (m_busDevices[iPtr]->GetType() == type && m_busDevices[iPtr]->GetStatus() == CEC_DEVICE_STATUS_PRESENT) return true; + } + return false; } -- 2.34.1