From: Lars Op den Kamp Date: Sun, 12 Feb 2012 19:32:30 +0000 (+0100) Subject: cec: reconnect SL after TV standby X-Git-Tag: upstream/2.2.0~1^2~35^2~87 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5c3b1f92b98bfbc26c59ec8d21e66fc7fcbcd700;p=deb_libcec.git cec: reconnect SL after TV standby --- 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;