Skip to content

Commit

Permalink
IsActiveDeviceType: poll only matching device type
Browse files Browse the repository at this point in the history
  • Loading branch information
Portisch committed Mar 7, 2020
1 parent ba9b538 commit 77509de
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/libcec/CECClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1459,9 +1459,17 @@ bool CCECClient::IsActiveDeviceType(const cec_device_type type)
{
CECDEVICEVEC activeDevices;
if (m_processor)
m_processor->GetDevices()->GetActive(activeDevices);
CCECDeviceMap::FilterType(type, activeDevices);
return !activeDevices.empty();
m_processor->GetDevices()->GetByType(type, activeDevices);

for (CECDEVICEVEC::iterator it = activeDevices.begin(); it != activeDevices.end(); it++)
{
cec_bus_device_status status = (*it)->GetStatus();
if (status == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC ||
status == CEC_DEVICE_STATUS_PRESENT)
return true;
}

return false;
}

cec_logical_address CCECClient::GetActiveSource(void)
Expand Down

0 comments on commit 77509de

Please sign in to comment.