cec: fixed - set power state to powered off when a device handled by libcec is made...
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 11d550c32adf7bdd6874eab1bef9d3e544e9789a..80bc280a3bb9b8af47e7be43582baa8ef9f22111 100644 (file)
@@ -564,7 +564,18 @@ bool CCECCommandHandler::HandleUserControlPressed(const cec_command &command)
       {
         CCECBusDevice *device = GetDevice(command.destination);
         if (device)
+        {
           device->SetPowerStatus(CEC_POWER_STATUS_ON);
+          if (device->MyLogicalAddressContains(device->GetLogicalAddress()))
+          {
+            device->SetActiveSource();
+            device->TransmitActiveSource();
+
+            if (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
+                device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE)
+              ((CCECPlaybackDevice *)device)->TransmitDeckStatus(command.initiator);
+          }
+        }
       }
 
       m_processor->SetCurrentButton((cec_user_control_code) command.parameters[0]);