cec: fixed - mark a device as active source before transmitting the active source...
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index 1793cc4c5af3431a42b07836908f85eee7b8ec55..f03f0cba0bbf590fd6d2baa325a5b6d56a595df2 100644 (file)
@@ -84,6 +84,9 @@ bool CCECBusDevice::HandleCommand(const cec_command &command)
   {
     CLockObject lock(&m_writeMutex);
     m_iLastActive = GetTimeMs();
+
+    if (m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC)
+      m_deviceStatus = CEC_DEVICE_STATUS_PRESENT;
   }
 
   /* handle the command */
@@ -437,7 +440,7 @@ void CCECBusDevice::SetInactiveDevice(void)
   m_bActiveSource = false;
 }
 
-void CCECBusDevice::SetActiveDevice(void)
+void CCECBusDevice::SetActiveSource(void)
 {
   CLockObject lock(&m_writeMutex);