From: Lars Op den Kamp Date: Thu, 8 Mar 2012 17:19:38 +0000 (+0100) Subject: cec: persist the configuration before closing the connection. only try to persist... X-Git-Tag: upstream/2.2.0~1^2~31^2~93 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cb4ee0286e826fa235d3efe6e3aad094464bd8d6;p=deb_libcec.git cec: persist the configuration before closing the connection. only try to persist the configuration when talking to a v2 firmware. bugzid: 543 --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index dee5f59..c1c999c 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -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; diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index 84a052d..4e6189c 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -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()) &&