From: Lars Op den Kamp Date: Tue, 22 Nov 2011 19:16:01 +0000 (+0100) Subject: cec: fixed - clear any previous input when opening a connection to the adapter. bugzi... X-Git-Tag: upstream/2.2.0~1^2~44^2~117 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=417aca8307ad062750be0ff8df9765ee380ef543;p=deb_libcec.git cec: fixed - clear any previous input when opening a connection to the adapter. bugzid: 54 --- diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index e772d35..74ea9e3 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -282,7 +282,7 @@ bool CAdapterCommunication::Open(const char *strPort, uint16_t iBaudRate /* = 38 //clear any input bytes uint8_t buff[1024]; - m_port->Read(buff, sizeof(buff), 500); + while (m_port->Read(buff, sizeof(buff), 500) > 0) {} if (CreateThread()) {