cec: fixed - ensure that the vendor commands are always sent for panasonic, and that...
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 46edf983c39e0ef71a6a1ac88a9c599c8fda9b04..05f5606b93b50fd5032a13e6a63fc7f766f5bc39 100644 (file)
@@ -1121,10 +1121,15 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f
 
     // update the power state and menu state
     m_busDevice->SetPowerStatus(CEC_POWER_STATUS_ON);
-    m_busDevice->SetMenuState(CEC_MENU_STATE_ACTIVATED); // TODO: LG
+    m_busDevice->SetMenuState(CEC_MENU_STATE_ACTIVATED);
+
+    // vendor specific hook
+    VendorPreActivateSourceHook();
 
     // power on the TV
-    bool bActiveSourceFailed = !m_busDevice->TransmitImageViewOn();
+    bool bActiveSourceFailed(false);
+    if (m_processor->GetDevice(CECDEVICE_TV)->GetPowerStatus(m_busDevice->GetLogicalAddress()) != CEC_POWER_STATUS_ON)
+      bActiveSourceFailed = !m_busDevice->TransmitImageViewOn();
 
     // check if we're allowed to switch sources
     bool bSourceSwitchAllowed = SourceSwitchAllowed();