From 718b36327e63c34d6eaebacfe1d3c9cd76fc86ef Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 12 Feb 2012 15:42:03 +0100 Subject: [PATCH] cec: stop replying to power status requests from LG when the power state is 'on' --- src/lib/implementations/SLCommandHandler.cpp | 13 +++++++++++++ src/lib/implementations/SLCommandHandler.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index fef6a4a..7b67a15 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -255,3 +255,16 @@ void CSLCommandHandler::SetDeckStatus(cec_deck_info deckStatus) if (device) ((CCECPlaybackDevice *)device)->SetDeckStatus(deckStatus); } + + +bool CSLCommandHandler::HandleGiveDevicePowerStatus(const cec_command &command) +{ + if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) + { + CCECBusDevice *device = GetDevice(command.destination); + if (device && device->GetPowerStatus(false) != CEC_POWER_STATUS_ON) + return device->TransmitPowerState(command.initiator); + } + + return false; +} diff --git a/src/lib/implementations/SLCommandHandler.h b/src/lib/implementations/SLCommandHandler.h index 55f1bea..7ba78ae 100644 --- a/src/lib/implementations/SLCommandHandler.h +++ b/src/lib/implementations/SLCommandHandler.h @@ -61,6 +61,7 @@ namespace CEC virtual void TransmitVendorCommand05(const cec_logical_address iSource, const cec_logical_address iDestination); virtual void SetDeckStatus(cec_deck_info deckStatus); + virtual bool HandleGiveDevicePowerStatus(const cec_command &command); bool m_bSLEnabled; bool m_bPowerStateReset; -- 2.34.1