only mark a device as active source from cache if it's powered on
[deb_libcec.git] / src / lib / devices / CECDeviceMap.cpp
index 1280de6e2f43eb4db87376e7529000b0c9a42bcd..b614e1a9175a1c322e28578fcee55ca2390ebb65 100644 (file)
@@ -208,6 +208,7 @@ CCECBusDevice *CCECDeviceMap::GetActiveSource(void) const
   for (CECDEVICEMAP::const_iterator it = m_busDevices.begin(); it != m_busDevices.end(); it++)
   {
     if (m_iActiveSource != CEC_INVALID_PHYSICAL_ADDRESS && !it->second->IsActiveSource() &&
+        it->second->GetCurrentPowerStatus() == CEC_POWER_STATUS_ON &&
         m_iActiveSource == it->second->GetCurrentPhysicalAddress())
       it->second->MarkAsActiveSource();
     if (it->second->IsActiveSource())