cec: ensure that the connection is really closed before retrying to connect. bugzig...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index a4bbcbc8e0b7ed0d6acb30f0190ed6f21b67a5dd..5b6fb033bebc3ceab5ea0984203b8c415a46046c 100644 (file)
@@ -188,6 +188,7 @@ bool CCECProcessor::OpenConnection(const char *strPort, uint16_t iBaudRate, uint
   while (timeout.TimeLeft() > 0 && (bReturn = m_communication->Open(this, (timeout.TimeLeft() / CEC_CONNECT_TRIES))) == false)
   {
     CLibCEC::AddLog(CEC_LOG_ERROR, "could not open a connection (try %d)", ++iConnectTry);
+    m_communication->Close();
     Sleep(500);
   }