From b74b93b0d95ef21c4bccbbc8ef53322b4b1565a5 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Thu, 19 Feb 2009 14:09:17 +0100 Subject: simplify cDxr3SyncBuffer::Pop --- dxr3syncbuffer.c | 24 +++++++----------------- dxr3syncbuffer.h | 1 - 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/dxr3syncbuffer.c b/dxr3syncbuffer.c index 95a9bd8..95fdbd2 100644 --- a/dxr3syncbuffer.c +++ b/dxr3syncbuffer.c @@ -290,23 +290,13 @@ cFixedLengthFrame* cDxr3SyncBuffer::Push(const uint8_t* pStart, int length, uint // ================================== void cDxr3SyncBuffer::Pop(void) { - if (m_count) - { - uint32_t nextPts = 0; - uint32_t tmpBuffer = m_next; - for (int i = 0; i < m_count && nextPts == 0; ++i) - { - if (tmpBuffer) tmpBuffer = --tmpBuffer ? tmpBuffer : (Size() - 1); - nextPts = m_pBuffer[tmpBuffer].GetPts(); - } - - m_next++; - m_count--; - m_next %= Size(); - if (m_next == m_nextFree) - { - m_next = m_nextFree = m_count = 0; - } + if (m_count) { + m_next++; + m_count--; + m_next %= Size(); + if (m_next == m_nextFree) { + m_next = m_nextFree = m_count = 0; + } } EnablePut(); } diff --git a/dxr3syncbuffer.h b/dxr3syncbuffer.h index 91fdb48..1ed7a83 100644 --- a/dxr3syncbuffer.h +++ b/dxr3syncbuffer.h @@ -27,7 +27,6 @@ #include #include "dxr3interface.h" #include "dxr3generaldefines.h" -#include "dxr3nextpts.h" #include "Uncopyable.h" // ================================== -- cgit v1.2.3