summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-04-15 09:55:32 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2017-04-15 09:55:32 +0200
commit1f541487e08b05685270f28059fa494e63b03c47 (patch)
tree584708da15a14011731c7dd3fe640ad93a8d9841 /device.c
parent1a160e7afeddd6a2479a40ee6110477093942707 (diff)
downloadvdr-1f541487e08b05685270f28059fa494e63b03c47.tar.gz
vdr-1f541487e08b05685270f28059fa494e63b03c47.tar.bz2
cTSBuffer::Skip() no longer immediately deletes the given number of bytes from the TS buffer
Diffstat (limited to 'device.c')
-rw-r--r--device.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/device.c b/device.c
index 38eb77f3..42cd21f9 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 4.13 2017/04/14 09:38:42 kls Exp $
+ * $Id: device.c 4.14 2017/04/15 09:44:50 kls Exp $
*/
#include "device.h"
@@ -1824,7 +1824,7 @@ cTSBuffer::cTSBuffer(int File, int Size, int CardIndex)
SetDescription("device %d TS buffer", CardIndex);
f = File;
cardIndex = CardIndex;
- delivered = false;
+ delivered = 0;
ringBuffer = new cRingBufferLinear(Size, TS_SIZE, true, "TS");
ringBuffer->SetTimeouts(100, 100);
ringBuffer->SetIoThrottle();
@@ -1864,8 +1864,8 @@ uchar *cTSBuffer::Get(int *Available, bool CheckAvailable)
{
int Count = 0;
if (delivered) {
- ringBuffer->Del(TS_SIZE);
- delivered = false;
+ ringBuffer->Del(delivered);
+ delivered = 0;
}
if (CheckAvailable && ringBuffer->Available() < TS_SIZE)
return NULL;
@@ -1882,7 +1882,7 @@ uchar *cTSBuffer::Get(int *Available, bool CheckAvailable)
esyslog("ERROR: skipped %d bytes to sync on TS packet on device %d", Count, cardIndex);
return NULL;
}
- delivered = true;
+ delivered = TS_SIZE;
if (Available)
*Available = Count;
return p;
@@ -1892,6 +1892,5 @@ uchar *cTSBuffer::Get(int *Available, bool CheckAvailable)
void cTSBuffer::Skip(int Count)
{
- ringBuffer->Del(Count);
- delivered = false;
+ delivered = Count;
}