cec: fixed - don't request the PA of devices when handling an incoming CEC command...
[deb_libcec.git] / src / lib / implementations / SLCommandHandler.cpp
index 6752c926572648aa1b8653b352e0edd477312582..f32209b332f0f22df0df8e5399b83340adde63d6 100644 (file)
@@ -127,7 +127,7 @@ bool CSLCommandHandler::HandleActiveSource(const cec_command &command)
   {
     uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
     CCECBusDevice *primary = m_processor->GetPrimaryDevice();
-    bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress(false) && primary->IsActiveSource());
+    bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress() && primary->IsActiveSource());
 
     m_processor->SetActiveSource(iAddress);
     if (bSendPowerOffState)
@@ -152,23 +152,11 @@ bool CSLCommandHandler::HandleDeviceVendorId(const cec_command &command)
   {
     cec_command response;
     cec_command::Format(response, m_processor->GetLogicalAddress(), command.initiator, CEC_OPCODE_FEATURE_ABORT);
-    return Transmit(response);
+    return Transmit(response, false);
   }
   return true;
 }
 
-bool CSLCommandHandler::HandleGivePhysicalAddress(const cec_command &command)
-{
-  if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination))
-  {
-    CCECBusDevice *device = GetDevice(command.destination);
-    if (device)
-      return device->TransmitPhysicalAddress(); // only the physical address, don't send image view on
-  }
-
-  return false;
-}
-
 bool CSLCommandHandler::HandleVendorCommand(const cec_command &command)
 {
   if (!m_busDevice->MyLogicalAddressContains(command.destination))
@@ -278,7 +266,7 @@ bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command)
     {
       if (command.parameters.size > 0)
       {
-        ((CCECPlaybackDevice *) device)->SetDeckStatus(!device->IsActiveSource() || !ActiveSourceSent() ? CEC_DECK_INFO_OTHER_STATUS : CEC_DECK_INFO_OTHER_STATUS_LG);
+        ((CCECPlaybackDevice *) device)->SetDeckStatus(!device->IsActiveSource() ? CEC_DECK_INFO_OTHER_STATUS : CEC_DECK_INFO_OTHER_STATUS_LG);
         if (command.parameters[0] == CEC_STATUS_REQUEST_ON)
         {
           bool bReturn = ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator);
@@ -411,10 +399,14 @@ bool CSLCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_
   {
     /* LG devices only allow themselves to be woken up by the TV with a vendor command */
     cec_command command;
+
+    if (!m_bSLEnabled)
+      TransmitVendorID(CECDEVICE_TV, CEC_VENDOR_LG);
+
     cec_command::Format(command, CECDEVICE_TV, iDestination, CEC_OPCODE_VENDOR_COMMAND);
     command.PushBack(SL_COMMAND_POWER_ON);
     command.PushBack(0);
-    return Transmit(command);
+    return Transmit(command, false);
   }
 
   return CCECCommandHandler::PowerOn(iInitiator, iDestination);