fixed typo in CCECBusDevice::SetActiveRoute(). issue #89
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index de75db5760b7e3bff8f3c365cc08ecdc07c8b7cf..b7b08c71e5e16922bd74af9ba8043f2dbb162bb8 100644 (file)
@@ -1130,9 +1130,12 @@ void CCECBusDevice::SetActiveRoute(uint16_t iRoute)
   if (!map)
     return;
 
-  CCECBusDevice* previouslyActive = map->GetActiveSource();
-  if (!previouslyActive)
+  CCECBusDevice* newRoute = m_processor->GetDeviceByPhysicalAddress(iRoute, true);
+  if (newRoute && newRoute->IsHandledByLibCEC())
+  {
+    newRoute->ActivateSource();
     return;
+  }
 
   CECDEVICEVEC devices;
   m_processor->GetDevices()->GetChildrenOf(devices, this);