mark a device as powered on when receiving a stream path or routing change
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index d50045af89eebe2ad5e3aaefbd5d29755d8a95ea..b304cb9c3e1a902b9a0ae2c0652fa93857bbb8ac 100644 (file)
@@ -537,9 +537,6 @@ bool CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress)
   {
     LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): physical address changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress, m_iPhysicalAddress, iNewAddress);
     m_iPhysicalAddress = iNewAddress;
-
-    if (m_processor->GetDevices()->GetActiveSourceAddress() == iNewAddress)
-      MarkAsActiveSource();
   }
   return true;
 }
@@ -1125,6 +1122,8 @@ bool CCECBusDevice::TransmitPendingActiveSourceCommands(void)
 
 void CCECBusDevice::SetActiveRoute(uint16_t iRoute)
 {
+  SetPowerStatus(CEC_POWER_STATUS_ON);
+
   CCECDeviceMap* map = m_processor->GetDevices();
   if (!map)
     return;
@@ -1145,6 +1144,8 @@ void CCECBusDevice::SetActiveRoute(uint16_t iRoute)
 
 void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */)
 {
+  SetPowerStatus(CEC_POWER_STATUS_ON);
+
   CLockObject lock(m_mutex);
   if (iNewAddress != m_iStreamPath)
   {