From: Lars Op den Kamp Date: Tue, 1 Nov 2011 20:37:42 +0000 (+0100) Subject: cec: signal as started after setting the ackmask X-Git-Tag: upstream/2.2.0~1^2~143 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e0407d3d1acb140e344b95c248259474a44ad89b;p=deb_libcec.git cec: signal as started after setting the ackmask --- diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index e94e8c0..2286a01 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -367,7 +367,7 @@ void CAdapterCommunication::WriteNextCommand(void) else { m_controller->AddLog(CEC_LOG_DEBUG, "command sent"); - CCondition::Sleep((uint32_t) msg->size() * (uint32_t)24 /*data*/ + (uint32_t)5 /*start bit (4.5 ms)*/); + CCondition::Sleep((uint32_t) msg->size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/ + 10); msg->state = ADAPTER_MESSAGE_STATE_SENT; } msg->condition.Signal(); diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 09e1ce4..cab483f 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -88,17 +88,17 @@ bool CCECProcessor::Start(void) void *CCECProcessor::Process(void) { + cec_command command; + CCECAdapterMessage msg; + + SetAckMask(0x1 << (uint8_t)m_iLogicalAddress); + { CLockObject lock(&m_mutex); m_controller->AddLog(CEC_LOG_DEBUG, "processor thread started"); m_startCondition.Signal(); } - cec_command command; - CCECAdapterMessage msg; - - SetAckMask(0x1 << (uint8_t)m_iLogicalAddress); - while (!IsStopped()) { bool bParseFrame(false);