cec: removed unneeded client version from the CCECProcessor constructor
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 20b8e059f329f210400fd9570af8c0c5f571fa25..918d4e97d93d84456a8971723896d8b34c98346a 100644 (file)
@@ -66,7 +66,7 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const libcec_configuration *co
     m_busDevices[CECDEVICE_TV]->ReplaceHandler(false);
 }
 
-CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types, uint16_t iPhysicalAddress, cec_client_version clientVersion) :
+CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types, uint16_t iPhysicalAddress) :
     m_bInitialised(false),
     m_communication(NULL),
     m_controller(controller),
@@ -78,7 +78,7 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, con
   m_configuration.Clear();
 
   // client version < 1.5.0
-  m_configuration.clientVersion    = clientVersion;
+  m_configuration.clientVersion    = CEC_CLIENT_VERSION_PRE_1_5;
   snprintf(m_configuration.strDeviceName, 13, "%s", strDeviceName);
   m_configuration.deviceTypes      = types;
   m_configuration.iPhysicalAddress = iPhysicalAddress;
@@ -853,6 +853,12 @@ bool CCECProcessor::IsActiveSource(cec_logical_address iAddress)
 
 bool CCECProcessor::Transmit(const cec_command &data)
 {
+  if (m_logicalAddresses[(uint8_t)data.destination])
+  {
+    CLibCEC::AddLog(CEC_LOG_WARNING, "not sending data to myself!");
+    return false;
+  }
+
   cec_adapter_message_state retVal(ADAPTER_MESSAGE_STATE_UNKNOWN);
   {
     CLockObject lock(m_mutex);