X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=3c3d84146cf96fc56b48da7c5b2e913542b0d6cd;hb=c23380e74349bd4bae7718b66a78a07a51a6f0fe;hp=a6b5d10302bab4c7baf77997620d25b8b9f88922;hpb=28fa6c976a4c91b515be4cb119f92e2000bbd90e;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index a6b5d10..3c3d841 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -87,6 +87,8 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) break; case CEC_OPCODE_DECK_CONTROL: HandleDeckControl(command); + /* pass to listeners */ + m_busDevice->GetProcessor()->AddCommand(command); break; case CEC_OPCODE_MENU_REQUEST: HandleMenuRequest(command); @@ -356,12 +358,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; }