summaryrefslogtreecommitdiff
path: root/ringbuffer.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-06-19 12:33:03 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2004-06-19 12:33:03 +0200
commita20f952f705e18394db26bf1121363c3529f6c05 (patch)
tree56ede4a64b0bef51d0f4dae01ba9a1639a3acc9b /ringbuffer.c
parentc4e0e6a54a9d55236264634b2e234eefcd618ccd (diff)
downloadvdr-a20f952f705e18394db26bf1121363c3529f6c05.tar.gz
vdr-a20f952f705e18394db26bf1121363c3529f6c05.tar.bz2
Fixed cRingBufferLinear::Get() in case the buffer wraps around
Diffstat (limited to 'ringbuffer.c')
-rw-r--r--ringbuffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ringbuffer.c b/ringbuffer.c
index 6f26748a..b52c37e5 100644
--- a/ringbuffer.c
+++ b/ringbuffer.c
@@ -7,7 +7,7 @@
* Parts of this file were inspired by the 'ringbuffy.c' from the
* LinuxDVB driver (see linuxtv.org).
*
- * $Id: ringbuffer.c 1.19 2004/03/07 13:46:51 kls Exp $
+ * $Id: ringbuffer.c 1.20 2004/06/19 12:27:56 kls Exp $
*/
#include "ringbuffer.h"
@@ -181,6 +181,7 @@ uchar *cRingBufferLinear::Get(int &Count)
int t = margin - rest;
memcpy(buffer + t, buffer + tail, rest);
tail = t;
+ rest = head - tail;
}
int diff = head - tail;
int cont = (diff >= 0) ? diff : Size() + diff - margin;