cec: get the vendor id of the TV before allocating logical addresses, so we can deter...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 0012a53d289f52591cb398f4c1bf1d152a68a120..034c7e660c56de66d1702781d5f636b3716a71fe 100644 (file)
@@ -645,6 +645,9 @@ bool CCECProcessor::RegisterClient(CCECClient *client)
     return false;
   }
 
+  // ensure that we know the vendor id of the TV
+  GetTV()->GetVendorId(CECDEVICE_UNREGISTERED);
+
   // unregister the client first if it's already been marked as registered
   if (client->IsRegistered())
     UnregisterClient(client);
@@ -720,6 +723,14 @@ bool CCECProcessor::RegisterClient(CCECClient *client)
     client->Alert(CEC_ALERT_SERVICE_DEVICE, param);
   }
 
+  // ensure that the command handler for the TV is initialised
+  if (bReturn)
+  {
+    CCECCommandHandler *handler = GetTV()->GetHandler();
+    if (handler)
+      handler->InitHandler();
+  }
+
   return bReturn;
 }