cec: sleep 5 ms in CUSBCECAdapterCommunication::Process() or other threads won't...
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.cpp
index c1645d047e37a35791a55674585aec4594409947..527292acc9d12c8ade59cf3caad4d1e85ea8d7d9 100644 (file)
@@ -224,7 +224,7 @@ void *CUSBCECAdapterCommunication::Process(void)
   {
     {
       CLockObject lock(m_mutex);
-      ReadFromDevice(50);
+      ReadFromDevice(5);
       bCommandReceived = m_callback && Read(command, 0) && m_bInitialised;
     }
 
@@ -240,7 +240,10 @@ void *CUSBCECAdapterCommunication::Process(void)
     }
 
     if (!IsStopped())
+    {
+      Sleep(5);
       WriteNextCommand();
+    }
   }
 
   /* notify all threads that are waiting on messages to be sent */
@@ -1026,7 +1029,6 @@ cec_datapacket CUSBCECAdapterCommunication::GetSetting(cec_adapter_messagecode m
     return retVal;
   }
 
-  Sleep(250); // TODO ReadFromDevice() isn't waiting for the timeout to pass on win32
   ReadFromDevice(CEC_DEFAULT_TRANSMIT_WAIT, iResponseLength + 3 /* start + msgcode + iResponseLength + end */);
   CCECAdapterMessage input;
   if (Read(input, 0))