cec: don't try to transmit when the processor is being stopped.
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 27 Feb 2012 13:09:17 +0000 (14:09 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 27 Feb 2012 13:09:45 +0000 (14:09 +0100)
src/lib/CECProcessor.cpp

index ae0a013634e98962c9bc46372f63e9b688071122..3568c16fb8b18c1997b1ffb7d788c5a032da28c9 100644 (file)
@@ -886,6 +886,8 @@ bool CCECProcessor::Transmit(const cec_command &data)
   uint8_t iMaxTries(0);
   {
     CLockObject lock(m_mutex);
+    if (IsStopped())
+      return false;
     LogOutput(data);
     m_iLastTransmission = GetTimeMs();
     if (!m_communication || !m_communication->IsOpen())
@@ -1564,10 +1566,10 @@ bool CCECProcessor::SetConfiguration(const libcec_configuration *configuration)
 
   if (bReinit)
   {
-               if (bDeviceTypeChanged)
-                       return ChangeDeviceType(oldPrimaryType, m_configuration.deviceTypes[0]);
-               else if (bPhysicalAddressChanged)
-                       return SetPhysicalAddress(m_configuration.iPhysicalAddress);
+    if (bDeviceTypeChanged)
+      return ChangeDeviceType(oldPrimaryType, m_configuration.deviceTypes[0]);
+    else if (bPhysicalAddressChanged)
+      return SetPhysicalAddress(m_configuration.iPhysicalAddress);
     else
       return SetHDMIPort(m_configuration.baseDevice, m_configuration.iHDMIPort);
   }