From: Lars Op den Kamp Date: Sun, 12 Feb 2012 14:42:03 +0000 (+0100) Subject: cec: stop replying to power status requests from LG when the power state is 'on' X-Git-Tag: upstream/2.2.0~1^2~35^2~91 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=718b36327e63c34d6eaebacfe1d3c9cd76fc86ef cec: stop replying to power status requests from LG when the power state is 'on' --- 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;