From: Mark Kendall Date: Tue, 24 Apr 2012 15:17:27 +0000 (+0100) Subject: Only respond to Give Physical Address with Report Physical Address. X-Git-Tag: upstream/2.2.0~1^2~29^2^2~52 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7656096e8198e19fd4f7b41cf9df54d811cf6fe3;p=deb_libcec.git Only respond to Give Physical Address with Report Physical Address. bugzid: 592 This fixes several reports of the TV improperly switching to the libcec device after it has previously switched to another source. Fix confirmed with Panasonic and also reported to be an issue with Samsung and Philips. The previous extra processing (SetActiveSource and ImageViewOn) was put in place for Samsung and may need revisiting. --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index c303871..37e3dda 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -334,12 +334,7 @@ bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command &command) { CCECBusDevice *device = GetDevice(command.destination); if (device) - { - device->SetActiveSource(); - return device->TransmitPhysicalAddress() && - device->TransmitImageViewOn() && - device->TransmitActiveSource(); - } + return device->TransmitPhysicalAddress(); } return false; diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index 957d296..5b8a729 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -157,18 +157,6 @@ bool CSLCommandHandler::HandleDeviceVendorId(const cec_command &command) return true; } -bool CSLCommandHandler::HandleGivePhysicalAddress(const cec_command &command) -{ - if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) - { - CCECBusDevice *device = GetDevice(command.destination); - if (device) - return device->TransmitPhysicalAddress(); // only the physical address, don't send image view on - } - - return false; -} - bool CSLCommandHandler::HandleVendorCommand(const cec_command &command) { if (!m_busDevice->MyLogicalAddressContains(command.destination)) diff --git a/src/lib/implementations/SLCommandHandler.h b/src/lib/implementations/SLCommandHandler.h index a0ea25a..6d84ec7 100644 --- a/src/lib/implementations/SLCommandHandler.h +++ b/src/lib/implementations/SLCommandHandler.h @@ -48,7 +48,6 @@ namespace CEC protected: virtual bool HandleActiveSource(const cec_command &command); virtual bool HandleDeviceVendorId(const cec_command &command); - virtual bool HandleGivePhysicalAddress(const cec_command &command); virtual bool HandleVendorCommand(const cec_command &command); virtual void HandleVendorCommand01(const cec_command &command);