cec: set the power state to 'powered on' by default
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 20 Dec 2011 22:27:18 +0000 (23:27 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 20 Dec 2011 22:27:18 +0000 (23:27 +0100)
src/lib/implementations/CECCommandHandler.cpp

index 0ca1557e9a6f298c36486238c7b1f42b28c70cd5..5a3de0b690c7d4015a2b27144e69c6ab69d7ef46 100644 (file)
@@ -927,8 +927,11 @@ bool CCECCommandHandler::InitHandler(void)
 {
   if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
   {
+    CCECBusDevice *primary = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
+    primary->SetPowerStatus(CEC_POWER_STATUS_ON);
+    primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
+
     m_processor->SetActiveSource();
-    m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary]->SetMenuState(CEC_MENU_STATE_ACTIVATED);
-    m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary]->TransmitMenuState(m_busDevice->GetLogicalAddress());
+    primary->TransmitMenuState(m_busDevice->GetLogicalAddress());
   }
 }