summaryrefslogtreecommitdiff
path: root/dxr3syncbuffer.c
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2009-02-19 14:09:17 +0100
committerChristian Gmeiner <christian.gmeiner@gmail.com>2009-02-19 14:09:17 +0100
commitb74b93b0d95ef21c4bccbbc8ef53322b4b1565a5 (patch)
treef910bc266b19055394ad05ba58b49be4bc3eacae /dxr3syncbuffer.c
parent9f9db2b92fb3a36db4b21e2b07bb6029d9adc4dc (diff)
downloadvdr-plugin-dxr3-b74b93b0d95ef21c4bccbbc8ef53322b4b1565a5.tar.gz
vdr-plugin-dxr3-b74b93b0d95ef21c4bccbbc8ef53322b4b1565a5.tar.bz2
simplify cDxr3SyncBuffer::Pop
Diffstat (limited to 'dxr3syncbuffer.c')
-rw-r--r--dxr3syncbuffer.c24
1 files changed, 7 insertions, 17 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();
}