X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=80bc280a3bb9b8af47e7be43582baa8ef9f22111;hb=3fd2a2b89c3f6f9d8e28c19e45622386a981ef8d;hp=57233fd3cc08aad07b346a8200e5f0771611765e;hpb=b022c181c03778c12291548e9726a7a18d3e5753;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 57233fd..80bc280 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -463,6 +463,14 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command) CStdString strLog; strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress); m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str()); + + /* one of the device handled by libCEC has been made active */ + CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); + if (device && m_busDevice->MyLogicalAddressContains(device->GetLogicalAddress())) + { + device->SetActiveSource(); + device->TransmitActiveSource(); + } } return false; } @@ -556,7 +564,18 @@ bool CCECCommandHandler::HandleUserControlPressed(const cec_command &command) { CCECBusDevice *device = GetDevice(command.destination); if (device) + { device->SetPowerStatus(CEC_POWER_STATUS_ON); + if (device->MyLogicalAddressContains(device->GetLogicalAddress())) + { + device->SetActiveSource(); + device->TransmitActiveSource(); + + if (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || + device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) + ((CCECPlaybackDevice *)device)->TransmitDeckStatus(command.initiator); + } + } } m_processor->SetCurrentButton((cec_user_control_code) command.parameters[0]);