X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=fee99806079f8aae569b87ad20ac7d82aebaf96a;hb=b6c7bc94e8a569d0fd49c1ecd1bcf02dcbee54c5;hp=a6b5d10302bab4c7baf77997620d25b8b9f88922;hpb=4f8dcef2e4f3268688b753478496c784d4e12c30;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index a6b5d10..fee9980 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -356,12 +356,21 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command) { if (command.parameters.size >= 2) { - uint16_t streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); + uint16_t iStreamAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); CStdString strLog; - strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, streamaddr); + strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress); m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str()); - return m_busDevice->GetProcessor()->SetStreamPath(streamaddr); + if (m_busDevice->GetProcessor()->SetStreamPath(iStreamAddress)) + { + CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); + if (device) + { + return device->TransmitActiveSource() && + device->TransmitMenuState(command.initiator); + } + } + return false; } return true; }