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 c72cc999325a8f5ae6a93c60d5804b24f73c54e7..395aacec69f4baa3dc80df13379cf128a9e78d1f 100644 (file)
@@ -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);