sync the /debian dir with the one in precise (with a couple of changes), because...
[deb_libcec.git] / src / lib / CECClient.cpp
index 4ac7243798e00fa35be75a8be6dae25ddff6da55..24f196f49287008800a01c1b88f76ff4d0463259 100644 (file)
@@ -234,8 +234,7 @@ bool CCECClient::SetPhysicalAddress(const uint16_t iPhysicalAddress)
   }
 
   // persist the new configuration
-  if (m_processor->CECInitialised())
-    m_processor->PersistConfiguration(m_configuration);
+  m_processor->PersistConfiguration(m_configuration);
 
   // set the physical address for each device
   SetDevicePhysicalAddress(iPhysicalAddress);
@@ -742,6 +741,13 @@ bool CCECClient::GetCurrentConfiguration(libcec_configuration &configuration)
     memcpy(configuration.strDeviceLanguage, m_configuration.strDeviceLanguage, 3);
     configuration.iFirmwareBuildDate      = m_configuration.iFirmwareBuildDate;
   }
+
+  // client version 1.6.3
+  if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_3)
+  {
+    configuration.bMonitorOnly            = m_configuration.bMonitorOnly;
+  }
+
   return true;
 }
 
@@ -793,6 +799,12 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration)
       memcpy(m_configuration.strDeviceLanguage, configuration.strDeviceLanguage, 3);
     }
 
+    // client version 1.6.3
+    if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_3)
+    {
+      m_configuration.bMonitorOnly = configuration.bMonitorOnly;
+    }
+
     // ensure that there is at least 1 device type set
     if (m_configuration.deviceTypes.IsEmpty())
       m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
@@ -818,8 +830,7 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration)
     SetPhysicalAddress(configuration);
   }
 
-  if (bIsRunning)
-    m_processor->PersistConfiguration(m_configuration);
+  m_processor->PersistConfiguration(m_configuration);
 
   if (!primary)
     primary = GetPrimaryDevice();
@@ -1177,7 +1188,10 @@ bool CCECClient::SwitchMonitoring(bool bEnable)
     if (bEnable)
       return m_processor->UnregisterClient(this);
     else
+    {
+      m_configuration.bMonitorOnly = false;
       return m_processor->RegisterClient(this);
+    }
   }
 
   return false;