cec: set the power status of a device to 'powered on' after it sends a stream path...
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index aa2a0dca503a49d4fbb6675e78b1ed912bd959eb..395aacec69f4baa3dc80df13379cf128a9e78d1f 100644 (file)
@@ -248,7 +248,7 @@ int CCECCommandHandler::HandleDeviceCecVersion(const cec_command &command)
 
 int CCECCommandHandler::HandleDeviceVendorCommandWithId(const cec_command & UNUSED(command))
 {
-  return CEC_ABORT_REASON_REFUSED;
+  return CEC_ABORT_REASON_INVALID_OPERAND;
 }
 
 int CCECCommandHandler::HandleDeviceVendorId(const cec_command &command)
@@ -561,7 +561,10 @@ int CCECCommandHandler::HandleSetStreamPath(const cec_command &command)
   if (command.parameters.size >= 2)
   {
     uint16_t iStreamAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
-    LIB_CEC->AddLog(CEC_LOG_DEBUG, ">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress);
+    LIB_CEC->AddLog(CEC_LOG_DEBUG, ">> %s (%x) sets stream path to physical address %04x", ToString(command.initiator), command.initiator, iStreamAddress);
+
+    // a device will only change the stream path when it's powered on
+    m_busDevice->SetPowerStatus(CEC_POWER_STATUS_ON);
 
     /* one of the device handled by libCEC has been made active */
     CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress);
@@ -713,7 +716,7 @@ int CCECCommandHandler::HandleUserControlRelease(const cec_command &command)
 
 int CCECCommandHandler::HandleVendorCommand(const cec_command & UNUSED(command))
 {
-  return CEC_ABORT_REASON_REFUSED;
+  return CEC_ABORT_REASON_INVALID_OPERAND;
 }
 
 void CCECCommandHandler::UnhandledCommand(const cec_command &command, const cec_abort_reason reason)