Skip to content

Commit

Permalink
fixed: 5e5788d didn't probe new devices
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Mar 29, 2020
1 parent 91da1b6 commit 416e136
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/libcec/CECClient.cpp
Expand Up @@ -1457,7 +1457,7 @@ bool CCECClient::IsActiveDevice(const cec_logical_address iAddress)

bool CCECClient::IsActiveDeviceType(const cec_device_type type)
{
return m_processor->GetDevices()->IsActiveType(type);
return m_processor->GetDevices()->IsActiveType(type, false);
}

cec_logical_address CCECClient::GetActiveSource(void)
Expand Down
13 changes: 9 additions & 4 deletions src/libcec/devices/CECBusDevice.cpp
Expand Up @@ -301,11 +301,16 @@ bool CCECBusDevice::IsHandledByLibCEC(void)
return m_deviceStatus == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC;
}

bool CCECBusDevice::IsActive(void)
bool CCECBusDevice::IsActive(bool suppressPoll /* = true */)
{
CLockObject lock(m_mutex);
return (m_deviceStatus == CEC_DEVICE_STATUS_PRESENT) ||
(m_deviceStatus == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC);
switch (GetStatus(false, suppressPoll))
{
case CEC_DEVICE_STATUS_PRESENT:
case CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC:
return true;
default:
return false;
}
}

void CCECBusDevice::SetUnsupportedFeature(cec_opcode opcode)
Expand Down
2 changes: 1 addition & 1 deletion src/libcec/devices/CECBusDevice.h
Expand Up @@ -111,7 +111,7 @@ namespace CEC
virtual const char* GetLogicalAddressName(void) const;
virtual bool IsPresent(void);
virtual bool IsHandledByLibCEC(void);
virtual bool IsActive(void);
virtual bool IsActive(bool suppressPoll = true);

virtual bool HandleCommand(const cec_command &command);
virtual bool IsUnsupportedFeature(cec_opcode opcode);
Expand Down
4 changes: 2 additions & 2 deletions src/libcec/devices/CECDeviceMap.cpp
Expand Up @@ -184,14 +184,14 @@ void CCECDeviceMap::GetActive(CECDEVICEVEC &devices) const
}
}

bool CCECDeviceMap::IsActiveType(const cec_device_type type) const
bool CCECDeviceMap::IsActiveType(const cec_device_type type, bool suppressPoll /* = true */) const
{
for (auto it = m_busDevices.begin(); it != m_busDevices.end(); ++it)
{
auto dev = it->second;
if (!!dev &&
(dev->GetType() == type) &&
(dev->IsActive())) {
(dev->IsActive(suppressPoll))) {
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcec/devices/CECDeviceMap.h
Expand Up @@ -63,7 +63,7 @@ namespace CEC
void GetLibCECControlled(CECDEVICEVEC &devices) const;
void GetByLogicalAddresses(CECDEVICEVEC &devices, const cec_logical_addresses &addresses);
void GetActive(CECDEVICEVEC &devices) const;
bool IsActiveType(const cec_device_type type) const;
bool IsActiveType(const cec_device_type type, bool suppressPoll = true) const;
void GetByType(const cec_device_type type, CECDEVICEVEC &devices) const;
void GetChildrenOf(CECDEVICEVEC& devices, CCECBusDevice* device) const;
void SignalAll(cec_opcode opcode);
Expand Down

0 comments on commit 416e136

Please sign in to comment.