transmit an active source message after <set stream path> to a device that's handled...
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index 5b3e2cb42626fc1566bd215ea407236e76c11492..2998a622021786c7e3e9ba162870f1b92aa45373 100644 (file)
@@ -95,6 +95,9 @@ CCECBusDevice::~CCECBusDevice(void)
 
 bool CCECBusDevice::ReplaceHandler(bool bActivateSource /* = true */)
 {
+  if (m_iLogicalAddress == CECDEVICE_BROADCAST)
+    return false;
+
   bool bInitHandler(false);
   {
     CLockObject lock(m_mutex);
@@ -1084,6 +1087,10 @@ void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /*
   {
     // if a device is found with the new physical address, mark it as active, which will automatically mark all other devices as inactive
     device->MarkAsActiveSource();
+
+    // respond with an active source message if this device is handled by libCEC
+    if (device->IsHandledByLibCEC())
+      device->TransmitActiveSource(true);
   }
   else
   {