condensed front() and pop() into pop()

unstable
Tom Early 4 years ago
parent 048bb6d9ba
commit 197fb2c166

@ -181,9 +181,8 @@ void CCodecStream::Task(void)
// pop the original packet
if ( !m_LocalQueue.empty() )
{
auto Packet = m_LocalQueue.front();
auto Packet = m_LocalQueue.pop();
auto Frame = (CDvFramePacket *)Packet.get();
m_LocalQueue.pop();
// todo: check the PID
// update content with transcoded ambe
Frame->SetAmbe(m_uiCodecOut, Ambe);
@ -208,9 +207,8 @@ void CCodecStream::Task(void)
while ( !empty() )
{
// yes, pop it from queue
auto Packet = front();
auto Packet = pop();
auto Frame = (CDvFramePacket *)Packet.get();
pop();
// yes, send to ambed
// this assume that thread pushing the Packet

@ -232,8 +232,7 @@ void CDcsProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());

@ -223,8 +223,7 @@ void CDextraProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// encode it
CBuffer buffer;

@ -351,8 +351,7 @@ void CDmrmmdvmProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());

@ -224,8 +224,7 @@ void CDmrplusProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());

@ -238,8 +238,7 @@ void CDplusProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());

@ -452,8 +452,7 @@ void CG3Protocol::HandleQueue(void)
m_LastKeepaliveTime.start();
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// encode it
CBuffer buffer;

@ -39,9 +39,8 @@ public:
void Unlock() { m_Mutex.unlock(); }
// pass thru
void pop() { queue.pop(); }
std::unique_ptr<CPacket> pop() { auto pack = std::move(queue.front()); queue.pop(); return std::move(pack); }
bool empty() const { return queue.empty(); }
std::unique_ptr<CPacket> front() { return std::move(queue.front()); }
void push(std::unique_ptr<CPacket> &packet) { queue.push(std::move(packet)); }
protected:

@ -283,8 +283,7 @@ void CReflector::RouterThread(CPacketStream *streamIn)
if ( !streamIn->empty() )
{
// get the packet
packet = streamIn->front();
streamIn->pop();
packet = streamIn->pop();
}
else
{

@ -224,8 +224,7 @@ void CUlxProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// check if origin of packet is local
// if not, do not stream it out as it will cause

@ -279,8 +279,7 @@ void CYsfProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());

Loading…
Cancel
Save

Powered by TurnKey Linux.