cec: persist the configuration before closing the connection. only try to persist...
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 8 Mar 2012 17:19:38 +0000 (18:19 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 8 Mar 2012 17:19:43 +0000 (18:19 +0100)
src/lib/CECProcessor.cpp
src/lib/adapter/USBCECAdapterCommunication.cpp

index dee5f5949af2321acdfbb62a0682599014305d67..c1c999c34454d95e6f214a956f81ccc763287f8a 100644 (file)
@@ -150,6 +150,7 @@ void CCECProcessor::Close(void)
 
   if (bClose && m_communication)
   {
+    m_communication->PersistConfiguration(&m_configuration);
     m_communication->Close();
     delete m_communication;
     m_communication = NULL;
index 84a052dd302bab6c50b9b15dc5dc3fa0890ae9cb..4e6189cee7aab847a54451082da7b2a4756598b7 100644 (file)
@@ -571,6 +571,9 @@ bool CUSBCECAdapterCommunication::SetAckMaskInternal(uint16_t iMask, bool bWrite
 
 bool CUSBCECAdapterCommunication::PersistConfiguration(libcec_configuration *configuration)
 {
+  if (m_iFirmwareVersion < 2)
+    return false;
+
   return SetAutoEnabled(true) &&
       SetDefaultLogicalAddress(configuration->logicalAddresses.primary) &&
       SetLogicalAddressMask(configuration->logicalAddresses.AckMask()) &&