X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=5fe6d4dd26ee0060267dfd90880b2ad123a00947;hb=844eab4ec63477613b4ec5747e6994521108d4b3;hp=5137cfbc00ad08ce7bf7940cd9fde57e30586484;hpb=1a1e2e6c67d1812527c14a2e5bbb359b63567476;p=deb_libcec.git diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 5137cfb..5fe6d4d 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -1066,6 +1066,26 @@ bool CCECBusDevice::TransmitPendingActiveSourceCommands(void) return bReturn; } +void CCECBusDevice::SetActiveRoute(uint16_t iRoute) +{ + CCECDeviceMap* map = m_processor->GetDevices(); + if (!map) + return; + + CCECBusDevice* previouslyActive = map->GetActiveSource(); + if (!previouslyActive) + return; + + CECDEVICEVEC devices; + m_processor->GetDevices()->GetChildrenOf(devices, this); + + for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++) + { + if (!CCECTypeUtils::PhysicalAddressIsIncluded(iRoute, (*it)->GetCurrentPhysicalAddress())) + (*it)->MarkAsInactiveSource(); + } +} + void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */) { CLockObject lock(m_mutex);