From bf1b57e032c24e4175511c0d9263f366edeee914 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 21 Jun 2012 11:22:27 +0200 Subject: [PATCH] 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 --- src/lib/implementations/CECCommandHandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.34.1