cec: replace the handler directly after getting the vendor id of a device when regist...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 324c5580e7439d8c21c62c108124824f2f0894d0..28adee3282e4a22b6631a267403b5df512ed544f 100644 (file)
@@ -207,7 +207,7 @@ void *CCECProcessor::Process(void)
 {
   m_libcec->AddLog(CEC_LOG_DEBUG, "processor thread started");
 
-  cec_command command;
+  cec_command command; command.Clear();
   CTimeout activeSourceCheck(ACTIVE_SOURCE_CHECK_INTERVAL);
 
   // as long as we're not being stopped and the connection is open
@@ -637,7 +637,9 @@ bool CCECProcessor::RegisterClient(CCECClient *client)
   }
 
   // ensure that we know the vendor id of the TV
-  GetTV()->GetVendorId(CECDEVICE_UNREGISTERED);
+  CCECBusDevice *tv = GetTV();
+  tv->GetVendorId(CECDEVICE_UNREGISTERED);
+  tv->ReplaceHandler(false);
 
   // unregister the client first if it's already been marked as registered
   if (client->IsRegistered())
@@ -679,7 +681,7 @@ bool CCECProcessor::RegisterClient(CCECClient *client)
   // get the settings from the rom
   if (configuration.bGetSettingsFromROM == 1)
   {
-    libcec_configuration config;
+    libcec_configuration config; config.Clear();
     m_communication->GetConfiguration(config);
 
     CLockObject lock(m_mutex);