From: Lars Op den Kamp Date: Thu, 11 Oct 2012 12:12:25 +0000 (+0200) Subject: fixed - CCECClient::IsLibCECActiveSource returns false now while the active source... X-Git-Tag: upstream/2.2.0~1^2~15^2^2~8 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=11bd2bd7874f9a19bc61694bec44ec58122f6cfe fixed - CCECClient::IsLibCECActiveSource returns false now while the active source command is pending --- diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp index d6f8100..9a28916 100644 --- a/src/lib/CECClient.cpp +++ b/src/lib/CECClient.cpp @@ -1344,7 +1344,7 @@ bool CCECClient::IsLibCECActiveSource(void) cec_logical_address activeSource = m_processor->GetActiveSource(); CCECBusDevice *device = m_processor->GetDevice(activeSource); if (device) - bReturn = device->IsHandledByLibCEC(); + bReturn = device->IsHandledByLibCEC() && !device->GetHandler()->ActiveSourcePending(); } return bReturn; } diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index 61f9f47..fca8a96 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -97,6 +97,7 @@ namespace CEC virtual bool SupportsDeviceType(const cec_device_type UNUSED(type)) const { return true; }; virtual cec_device_type GetReplacementDeviceType(const cec_device_type type) const { return type; } + virtual bool ActiveSourcePending(void) const { return m_iActiveSourcePending != 0; } protected: virtual int HandleActiveSource(const cec_command &command);