mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
cTSBuffer::Skip() no longer immediately deletes the given number of bytes from the TS buffer
This commit is contained in:
parent
1a160e7afe
commit
1f541487e0
6
HISTORY
6
HISTORY
@ -8972,3 +8972,9 @@ Video Disk Recorder Revision History
|
|||||||
plugins that implement a derived cDevice need to call Decrypt() in their
|
plugins that implement a derived cDevice need to call Decrypt() in their
|
||||||
GetTSPacket() function even if the incoming buffer is currently empty (see
|
GetTSPacket() function even if the incoming buffer is currently empty (see
|
||||||
cDvbDevice::GetTSPacket()).
|
cDvbDevice::GetTSPacket()).
|
||||||
|
- cTSBuffer::Skip() no longer immediately deletes the given number of bytes from the
|
||||||
|
TS buffer, but rather stores the number for later deletion in the next call to
|
||||||
|
Get(). This is necessary because in cDvbDevice::GetTSPacket() tsBuffer->Skip()
|
||||||
|
is called, but the actual TS packet returned (pointed to by Data) may well be
|
||||||
|
(and typically is, unless the CAM copies the data) in the area of the buffer that
|
||||||
|
would be deleted by Skip().
|
||||||
|
13
device.c
13
device.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "device.h"
|
||||||
@ -1824,7 +1824,7 @@ cTSBuffer::cTSBuffer(int File, int Size, int CardIndex)
|
|||||||
SetDescription("device %d TS buffer", CardIndex);
|
SetDescription("device %d TS buffer", CardIndex);
|
||||||
f = File;
|
f = File;
|
||||||
cardIndex = CardIndex;
|
cardIndex = CardIndex;
|
||||||
delivered = false;
|
delivered = 0;
|
||||||
ringBuffer = new cRingBufferLinear(Size, TS_SIZE, true, "TS");
|
ringBuffer = new cRingBufferLinear(Size, TS_SIZE, true, "TS");
|
||||||
ringBuffer->SetTimeouts(100, 100);
|
ringBuffer->SetTimeouts(100, 100);
|
||||||
ringBuffer->SetIoThrottle();
|
ringBuffer->SetIoThrottle();
|
||||||
@ -1864,8 +1864,8 @@ uchar *cTSBuffer::Get(int *Available, bool CheckAvailable)
|
|||||||
{
|
{
|
||||||
int Count = 0;
|
int Count = 0;
|
||||||
if (delivered) {
|
if (delivered) {
|
||||||
ringBuffer->Del(TS_SIZE);
|
ringBuffer->Del(delivered);
|
||||||
delivered = false;
|
delivered = 0;
|
||||||
}
|
}
|
||||||
if (CheckAvailable && ringBuffer->Available() < TS_SIZE)
|
if (CheckAvailable && ringBuffer->Available() < TS_SIZE)
|
||||||
return NULL;
|
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);
|
esyslog("ERROR: skipped %d bytes to sync on TS packet on device %d", Count, cardIndex);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
delivered = true;
|
delivered = TS_SIZE;
|
||||||
if (Available)
|
if (Available)
|
||||||
*Available = Count;
|
*Available = Count;
|
||||||
return p;
|
return p;
|
||||||
@ -1892,6 +1892,5 @@ uchar *cTSBuffer::Get(int *Available, bool CheckAvailable)
|
|||||||
|
|
||||||
void cTSBuffer::Skip(int Count)
|
void cTSBuffer::Skip(int Count)
|
||||||
{
|
{
|
||||||
ringBuffer->Del(Count);
|
delivered = Count;
|
||||||
delivered = false;
|
|
||||||
}
|
}
|
||||||
|
4
device.h
4
device.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: device.h 4.6 2017/04/14 09:59:20 kls Exp $
|
* $Id: device.h 4.7 2017/04/15 09:41:34 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __DEVICE_H
|
#ifndef __DEVICE_H
|
||||||
@ -840,7 +840,7 @@ class cTSBuffer : public cThread {
|
|||||||
private:
|
private:
|
||||||
int f;
|
int f;
|
||||||
int cardIndex;
|
int cardIndex;
|
||||||
bool delivered;
|
int delivered;
|
||||||
cRingBufferLinear *ringBuffer;
|
cRingBufferLinear *ringBuffer;
|
||||||
virtual void Action(void);
|
virtual void Action(void);
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user