X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FSLCommandHandler.cpp;h=7b3b427af2f4154f8a449851f50c15d2aa0e49cf;hb=5c3b1f92b98bfbc26c59ec8d21e66fc7fcbcd700;hp=1d4c8c5a70605ae75db52a019a88d21e94432b6c;hpb=5abb18f38e146cebabd9ec1b7538459f41249a58;p=deb_libcec.git 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; +}