From 5c3b1f92b98bfbc26c59ec8d21e66fc7fcbcd700 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 12 Feb 2012 20:32:30 +0100 Subject: [PATCH] cec: reconnect SL after TV standby --- src/lib/implementations/SLCommandHandler.cpp | 27 ++++++++++++++++++++ src/lib/implementations/SLCommandHandler.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index 1d4c8c5..7b3b427 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -292,3 +292,30 @@ bool CSLCommandHandler::HandleRequestActiveSource(const cec_command &command) } return false; } + +bool CSLCommandHandler::HandleFeatureAbort(const cec_command &command) +{ + if (command.parameters.size == 0 && m_processor->GetPrimaryDevice()->GetPowerStatus() == CEC_POWER_STATUS_ON && !m_bSLEnabled) + { + m_processor->GetPrimaryDevice()->TransmitPowerState(command.initiator); + m_processor->GetPrimaryDevice()->TransmitVendorID(CECDEVICE_BROADCAST, false); + } + + return CCECCommandHandler::HandleFeatureAbort(command); +} + +bool CSLCommandHandler::HandleStandby(const cec_command &command) +{ + if (command.initiator == CECDEVICE_TV) + { + m_bSLEnabled = false; + m_bPowerStateReset = false; + m_bActiveSourceSent = false; + } + + CCECBusDevice *device = GetDevice(command.initiator); + if (device) + device->SetPowerStatus(CEC_POWER_STATUS_STANDBY); + + return true; +} diff --git a/src/lib/implementations/SLCommandHandler.h b/src/lib/implementations/SLCommandHandler.h index e24dac7..8012f2e 100644 --- a/src/lib/implementations/SLCommandHandler.h +++ b/src/lib/implementations/SLCommandHandler.h @@ -62,6 +62,8 @@ namespace CEC virtual bool HandleGiveDevicePowerStatus(const cec_command &command); virtual bool HandleGiveDeckStatus(const cec_command &command); virtual bool HandleRequestActiveSource(const cec_command &command); + virtual bool HandleFeatureAbort(const cec_command &command); + virtual bool HandleStandby(const cec_command &command); bool m_bSLEnabled; bool m_bPowerStateReset; -- 2.34.1