From aab5cd7a7e40003b8b94ada86b4734c78ad06ea8 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 31 Oct 2012 13:36:03 +0100 Subject: [PATCH] fixed - LG doesn't send routing changes, and marks the TV as active source when switching to another source that's not been selected in the simplink menu instead. this change keeps libCEC marked as powered on and keep the deck state set to CEC_DECK_INFO_OTHER_STATUS_LG. fixes keypresses not working after switching to another source and back to libCEC's hdmi port via the source select menu instead of the simplink menu. github issue #71 --- src/lib/implementations/SLCommandHandler.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index f495b8b..7c9579d 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -115,19 +115,13 @@ int CSLCommandHandler::HandleActiveSource(const cec_command &command) if (command.parameters.size == 2) { uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); - CCECBusDevice *primary = m_processor->GetPrimaryDevice(); - bool bSendPowerOffState(iAddress != primary->GetCurrentPhysicalAddress() && primary->IsActiveSource()); - CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iAddress); if (device) device->MarkAsActiveSource(); - if (bSendPowerOffState) + { - { - CLockObject lock(m_SLMutex); - m_bActiveSourceSent = false; - } - primary->TransmitPowerState(CECDEVICE_TV, false); + CLockObject lock(m_SLMutex); + m_bActiveSourceSent = false; } return COMMAND_HANDLED; @@ -273,7 +267,7 @@ int CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command) if (!device || command.parameters.size == 0) return CEC_ABORT_REASON_INVALID_OPERAND; - device->SetDeckStatus(!device->IsActiveSource() ? CEC_DECK_INFO_OTHER_STATUS : CEC_DECK_INFO_OTHER_STATUS_LG); + device->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG); if (command.parameters[0] == CEC_STATUS_REQUEST_ON) { device->TransmitDeckStatus(command.initiator, true); -- 2.34.1