cec: fixed typo which prevented LG TVs from connecting sometimes
[deb_libcec.git] / src / lib / implementations / SLCommandHandler.cpp
index e63f1bb08a2df0db064fdb151ec1e71c4a138c98..c068540c486db3ce8bf92bc775ad3b9d8b6eb807 100644 (file)
@@ -246,6 +246,10 @@ bool CSLCommandHandler::HandleReceiveFailed(void)
 
 bool CSLCommandHandler::InitHandler(void)
 {
+  if (m_bHandlerInited)
+    return true;
+  m_bHandlerInited = true;
+
   m_processor->SetStandardLineTimeout(3);
   m_processor->SetRetryLineTimeout(3);
 
@@ -301,7 +305,7 @@ bool CSLCommandHandler::InitHandler(void)
 bool CSLCommandHandler::TransmitPowerOn(const cec_logical_address iInitiator, const cec_logical_address iDestination)
 {
   if (iDestination != CECDEVICE_BROADCAST &&
-      iDestination != CECDEVICE_TV &&
+      iInitiator != CECDEVICE_TV &&
       m_processor->m_busDevices[iDestination]->GetVendorId(false) == CEC_VENDOR_LG)
   {
     cec_command command;