LG: newer firmwares don't send a second power status request after it's been requeste...
[deb_libcec.git] / src / lib / implementations / SLCommandHandler.cpp
index e686fdd800edf383416522563eab4ab0b06f7b58..73a27f5e63cd2b3a6f6c63dc6b79b187e84f0308 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
@@ -194,6 +194,10 @@ void CSLCommandHandler::HandleVendorCommand01(const cec_command &command)
 {
   m_processor->GetPrimaryDevice()->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
   TransmitVendorCommand0205(command.destination, command.initiator);
+
+  CCECBusDevice* dev = m_processor->GetDevice(command.destination);
+  if (dev && dev->IsHandledByLibCEC() && dev->IsActiveSource())
+    dev->TransmitActiveSource(false);
 }
 
 void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSource, const cec_logical_address iDestination)
@@ -204,6 +208,7 @@ void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSou
   response.PushBack(SL_COMMAND_TYPE_HDDRECORDER);
 
   Transmit(response, false, true);
+  SetSLInitialised();
 }
 
 void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
@@ -227,6 +232,8 @@ void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
       CLockObject lock(m_SLMutex);
       m_bActiveSourceSent = false;
     }
+    if (device->IsActiveSource())
+      ActivateSource();
   }
 }
 void CSLCommandHandler::HandleVendorCommandPowerOnStatus(const cec_command &command)