cec: also send deck status 0x20 when no active source message has been sent, or keypr...
[deb_libcec.git] / src / lib / implementations / SLCommandHandler.cpp
index e8cdf43f8e4d10128e0fc76ef6dc992b8a9755d7..692a5fd824b51f722e1f89b728660bfa65c8eb9b 100644 (file)
@@ -68,9 +68,8 @@ CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) :
     primary->ReplaceHandler(false);
   }
 
-  /* LG TVs don't always reply to CEC version requests, so just set it to 1.3a */
-  if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
-    m_busDevice->SetCecVersion(CEC_VERSION_1_3A);
+  /* LG devices don't always reply to CEC version requests, so just set it to 1.3a */
+  m_busDevice->SetCecVersion(CEC_VERSION_1_3A);
 
   /* LG devices always return "korean" as language */
   cec_menu_language lang;
@@ -229,7 +228,17 @@ void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
   {
     SetSLInitialised();
     device->SetActiveSource();
-    ActivateSource();
+    device->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
+    device->TransmitPowerState(command.initiator);
+
+    CEvent::Sleep(2000);
+    device->SetPowerStatus(CEC_POWER_STATUS_ON);
+    device->TransmitPowerState(command.initiator);
+    device->TransmitPhysicalAddress();
+    {
+      CLockObject lock(m_SLMutex);
+      m_bActiveSourceSent = false;
+    }
   }
 }
 void CSLCommandHandler::HandleVendorCommandPowerOnStatus(const cec_command &command)
@@ -273,7 +282,8 @@ bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command)
         if (command.parameters[0] == CEC_STATUS_REQUEST_ON)
         {
           bool bReturn = ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator);
-          ActivateSource();
+          if (!ActiveSourceSent())
+            ActivateSource();
           return bReturn;
         }
         else if (command.parameters[0] == CEC_STATUS_REQUEST_ONCE)