cec: store the status of a bus device: present, not present or handled by libcec
[deb_libcec.git] / src / lib / CECProcessor.cpp
index a51abc7917b2fdc48fa4b789e6277027f1f33d1d..cf6405370b1dce2390d7c1b0ba7fc4a843598c24 100644 (file)
@@ -158,6 +158,7 @@ bool CCECProcessor::TryLogicalAddress(cec_logical_address address, unsigned int
     }
     m_busDevices[address]->m_powerStatus = CEC_POWER_STATUS_STANDBY;
     m_busDevices[address]->m_cecVersion =  CEC_VERSION_1_3A;
+    m_busDevices[address]->m_deviceStatus = CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC;
 
     m_logicalAddresses.Set(address);
 
@@ -360,12 +361,7 @@ bool CCECProcessor::SetStreamPath(uint16_t iStreamPath)
   CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath);
   if (device)
   {
-    for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
-      m_busDevices[iPtr]->m_bActiveSource = false;
-
-    device->m_bActiveSource = true;
-    device->m_powerStatus   = CEC_POWER_STATUS_ON;
-
+    device->SetActiveDevice();
     bReturn = true;
   }