cec: ensure that the connection is really closed before retrying to connect. bugzig...
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 27 Feb 2012 19:57:41 +0000 (20:57 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 27 Feb 2012 19:57:41 +0000 (20:57 +0100)
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);
   }