cec: removed 'retries' from cec_command, to avoid stack smashing when upgrading the...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index e1e03b868d1ee6925bf319fd26c6f2b29fb801a8..a3c22df3169ad9f3851b3b34a30fd38c22cd96c7 100644 (file)
@@ -717,6 +717,13 @@ bool CCECProcessor::Transmit(const cec_command &data)
   LogOutput(data);
 
   CCECAdapterMessage *output = new CCECAdapterMessage(data);
+
+  /* set the number of retries */
+  if (data.opcode == CEC_OPCODE_NONE)
+    output->maxTries = 1;
+  else if (data.initiator != CECDEVICE_BROADCAST)
+    output->maxTries = m_busDevices[data.initiator]->GetHandler()->GetTransmitRetries() + 1;
+
   bReturn = Transmit(output);
 
   /* set to "not present" on failed ack */