From: Lars Op den Kamp Date: Thu, 17 May 2012 10:56:08 +0000 (+0200) Subject: cec: fixed - correct initiator for keypresses X-Git-Tag: upstream/2.2.0~1^2~27^2^2~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7fe6a9d88002fc9df6173c728102f79b45d3e561;p=deb_libcec.git cec: fixed - correct initiator for keypresses --- diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp index 24f196f..5b45297 100644 --- a/src/lib/CECClient.cpp +++ b/src/lib/CECClient.cpp @@ -678,21 +678,19 @@ uint8_t CCECClient::SendMuteAudio(void) bool CCECClient::SendKeypress(const cec_logical_address iDestination, const cec_user_control_code key, bool bWait /* = true */) { - CCECBusDevice *device = GetPrimaryDevice(); CCECBusDevice *dest = m_processor->GetDevice(iDestination); - return device && dest ? - device->TransmitKeypress(GetPrimaryLogicalAdddress(), key, bWait) : + return dest ? + dest->TransmitKeypress(GetPrimaryLogicalAdddress(), key, bWait) : false; } bool CCECClient::SendKeyRelease(const cec_logical_address iDestination, bool bWait /* = true */) { - CCECBusDevice *device = GetPrimaryDevice(); CCECBusDevice *dest = m_processor->GetDevice(iDestination); - return device && dest ? - device->TransmitKeyRelease(GetPrimaryLogicalAdddress(), bWait) : + return dest ? + dest->TransmitKeyRelease(GetPrimaryLogicalAdddress(), bWait) : false; }