diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-11-18 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-11-18 18:00:00 +0100 |
commit | 29b2d48bb53df75f1cb978e72bc709a6658d6e5c (patch) | |
tree | 8b5b7527e98c59d2446ba5b2c6365a1d484fe988 /ringbuffer.c | |
parent | 182cd78af06cee95594307b792b8951153c4888e (diff) | |
download | vdr-patch-lnbsharing-29b2d48bb53df75f1cb978e72bc709a6658d6e5c.tar.gz vdr-patch-lnbsharing-29b2d48bb53df75f1cb978e72bc709a6658d6e5c.tar.bz2 |
Version 1.5.12vdr-1.5.12
- Fixed assembling PS1 packets in cTS2PES::instant_repack() (thanks to Reinhard
Nissl).
- Updated the Russian OSD texts (thanks to Oleg Roitburd).
- Fixed handling small PES packets that caused subtitles to be displayed late
in live mode (based on a patch from Reinhard Nissl).
- Fixed stopping live subtitles when a player is attached to the device.
- Fixed suddenly stopping subtitles in live mode.
Diffstat (limited to 'ringbuffer.c')
-rw-r--r-- | ringbuffer.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ringbuffer.c b/ringbuffer.c index 0633bd3..d74706a 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.24 2006/06/16 09:32:13 kls Exp $ + * $Id: ringbuffer.c 1.25 2007/11/17 13:49:34 kls Exp $ */ #include "ringbuffer.h" @@ -187,6 +187,11 @@ cRingBufferLinear::~cRingBufferLinear() free(description); } +int cRingBufferLinear::DataReady(const uchar *Data, int Count) +{ + return Count >= margin ? Count : 0; +} + int cRingBufferLinear::Available(void) { int diff = head - tail; @@ -284,7 +289,6 @@ int cRingBufferLinear::Put(const uchar *Data, int Count) uchar *cRingBufferLinear::Get(int &Count) { - uchar *p = NULL; int Head = head; if (getThreadTid <= 0) getThreadTid = cThread::ThreadId(); @@ -299,13 +303,13 @@ uchar *cRingBufferLinear::Get(int &Count) int cont = (diff >= 0) ? diff : Size() + diff - margin; if (cont > rest) cont = rest; - if (cont >= margin) { - p = buffer + tail; + uchar *p = buffer + tail; + if ((cont = DataReady(p, cont)) > 0) { Count = gotten = cont; + return p; } - if (!p) - WaitForGet(); - return p; + WaitForGet(); + return NULL; } void cRingBufferLinear::Del(int Count) |