cec: fixed - correct initiator for keypresses
[deb_libcec.git] / src / lib / CECClient.cpp
index 24f196f49287008800a01c1b88f76ff4d0463259..5b4529788487f19305da14379242bb5e4fcd82fd 100644 (file)
@@ -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;
 }