cec: signal as started after setting the ackmask
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 1 Nov 2011 20:37:42 +0000 (21:37 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 1 Nov 2011 20:37:42 +0000 (21:37 +0100)
src/lib/AdapterCommunication.cpp
src/lib/CECProcessor.cpp

index e94e8c01b1880095887df982bc6b0c93fe046cab..2286a01e57080e8c12663e7b6c5a48d0d628f1c0 100644 (file)
@@ -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();
index 09e1ce4e0231de8c49b1c61c6d54e666dabd773a..cab483fee4bcb14b6319765785e6e1df3bbf65e3 100644 (file)
@@ -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);