From: Lars Op den Kamp Date: Thu, 21 Jun 2012 09:22:27 +0000 (+0200) Subject: cec: set the power status of a device to 'powered on' after it sends a stream path... X-Git-Tag: upstream/2.2.0~1^2~22^2^2~29 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bf1b57e032c24e4175511c0d9263f366edeee914;p=deb_libcec.git cec: set the power status of a device to 'powered on' after it sends a stream path change. can save an unneeded power state update request --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index c72cc99..395aace 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -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);