cec: removed m_outBuffer in CUSBCECAdapterCommunication. bugzid: 654
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 11 Apr 2012 14:39:53 +0000 (16:39 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 11 Apr 2012 15:48:08 +0000 (17:48 +0200)
src/lib/adapter/USBCECAdapterCommunication.cpp
src/lib/adapter/USBCECAdapterCommunication.h

index 8269d139885028dfe3d92955162667a0c754d2b4..fb6f26707ab06c53f5bd5c5600dd433b0b10ef0d 100644 (file)
@@ -238,16 +238,8 @@ void *CUSBCECAdapterCommunication::Process(void)
       pingTimeout.Init(CEC_ADAPTER_PING_TIMEOUT);
       PingAdapter();
     }
-
-    if (!IsStopped())
-      WriteNextCommand();
   }
 
-  /* notify all threads that are waiting on messages to be sent */
-  CCECAdapterMessage *msg(NULL);
-  while (m_outBuffer.Pop(msg))
-    msg->event.Broadcast();
-
   /* set the ackmask to 0 before closing the connection */
   SetAckMaskInternal(0, true);
 
@@ -304,7 +296,7 @@ cec_adapter_message_state CUSBCECAdapterCommunication::Write(const cec_command &
 bool CUSBCECAdapterCommunication::Write(CCECAdapterMessage *data)
 {
   data->state = ADAPTER_MESSAGE_STATE_WAITING_TO_BE_SENT;
-  m_outBuffer.Push(data);
+  SendMessageToAdapter(data);
   data->event.Wait(5000);
 
   if ((data->expectControllerAck && data->state != ADAPTER_MESSAGE_STATE_SENT_ACKED) ||
@@ -962,13 +954,6 @@ void CUSBCECAdapterCommunication::SendMessageToAdapter(CCECAdapterMessage *msg)
   msg->event.Signal();
 }
 
-void CUSBCECAdapterCommunication::WriteNextCommand(void)
-{
-  CCECAdapterMessage *msg(NULL);
-  if (m_outBuffer.Pop(msg))
-    SendMessageToAdapter(msg);
-}
-
 CStdString CUSBCECAdapterCommunication::GetPortName(void)
 {
   CStdString strName;
index 227a7e2625c3753a05a3034510d896e103aaa93e..73057043d8a0e169481db1e63ace9b8f95e66d04 100644 (file)
@@ -106,7 +106,6 @@ namespace CEC
     bool Read(CCECAdapterMessage &msg, uint32_t iTimeout = 1000);
     bool ParseMessage(const CCECAdapterMessage &msg);
     void SendMessageToAdapter(CCECAdapterMessage *msg);
-    void WriteNextCommand(void);
     void AddData(uint8_t *data, size_t iLen);
     bool ReadFromDevice(uint32_t iTimeout, size_t iSize = 256);
     bool WaitForAck(CCECAdapterMessage &message);
@@ -114,7 +113,6 @@ namespace CEC
     PLATFORM::ISocket *                          m_port;
     CCECProcessor *                              m_processor;
     PLATFORM::SyncedBuffer<CCECAdapterMessage *> m_inBuffer;
-    PLATFORM::SyncedBuffer<CCECAdapterMessage *> m_outBuffer;
     PLATFORM::CMutex                             m_mutex;
     PLATFORM::CCondition<volatile bool>          m_rcvCondition;
     volatile bool                                m_bHasData;