From: Lars Op den Kamp Date: Mon, 27 Feb 2012 19:57:41 +0000 (+0100) Subject: cec: ensure that the connection is really closed before retrying to connect. bugzig... X-Git-Tag: upstream/2.2.0~1^2~33^2~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d55f263f0fceeae13d0e046da20262307694c203;p=deb_libcec.git cec: ensure that the connection is really closed before retrying to connect. bugzig: 436 --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index a4bbcbc..5b6fb03 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -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); }