p8: don't disable controlled mode when switching to monitoring mode
[deb_libcec.git] / src / lib / CECClient.cpp
index b6c0812d2cbb1de4c37ab17b44fc2be7b44db83e..e7ac9556349601af73230fbc73904c918ed8777d 100644 (file)
@@ -1249,13 +1249,9 @@ bool CCECClient::SwitchMonitoring(bool bEnable)
 
   if (m_processor)
   {
-    if (bEnable)
-      return m_processor->UnregisterClient(this);
-    else
-    {
-      m_configuration.bMonitorOnly = false;
-      return m_processor->RegisterClient(this);
-    }
+    m_processor->SwitchMonitoring(bEnable);
+    m_configuration.bMonitorOnly = bEnable;
+    return bEnable ? true: m_processor->RegisterClient(this);
   }
 
   return false;