cec: reset m_bPowerUpEventReceived in CVLCommandHandler when the device lets us know...
[deb_libcec.git] / src / lib / implementations / VLCommandHandler.cpp
index aadf98823f69546952226ae06cf84f1e766f1108..74b26509569c11db5f853a5c9f07951116483dad 100644 (file)
@@ -159,17 +159,21 @@ bool CVLCommandHandler::PowerUpEventReceived(void)
       return true;
   }
 
-  cec_logical_address sourceLA = m_busDevice->GetLogicalAddress();
-  if (sourceLA == CECDEVICE_TV)
-    sourceLA = m_processor->GetPrimaryDevice()->GetLogicalAddress();
-
-  cec_power_status powerStatus = m_busDevice->GetPowerStatus(sourceLA);
-
   CLockObject lock(m_mutex);
-  m_bPowerUpEventReceived = (powerStatus == CEC_POWER_STATUS_ON);
+  m_bPowerUpEventReceived = (m_busDevice->GetCurrentPowerStatus() == CEC_POWER_STATUS_ON);
   return m_bPowerUpEventReceived;
 }
 
+int CVLCommandHandler::HandleStandby(const cec_command &command)
+{
+  {
+    CLockObject lock(m_mutex);
+    m_bPowerUpEventReceived = false;
+  }
+
+  return CCECCommandHandler::HandleStandby(command);
+}
+
 int CVLCommandHandler::HandleVendorCommand(const cec_command &command)
 {
   // some vendor command voodoo that will enable more buttons on the remote