1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Implemented HasLock() for prebuffering.

This commit is contained in:
Rolf Ahrenberg 2007-09-20 22:01:42 +00:00
parent d4133a8888
commit 6d0f27e710
2 changed files with 16 additions and 6 deletions

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.c,v 1.28 2007/09/20 21:15:08 rahrenbe Exp $ * $Id: device.c,v 1.29 2007/09/20 22:01:42 rahrenbe Exp $
*/ */
#include "common.h" #include "common.h"
@ -248,14 +248,19 @@ void cIptvDevice::CloseDvr(void)
isOpenDvr = false; isOpenDvr = false;
} }
bool cIptvDevice::HasLock(int TimeoutMs)
{
debug("cIptvDevice::HasLock(%d): %d\n", deviceIndex, TimeoutMs);
if (tsBufferPrefill && tsBuffer->Available() < tsBufferPrefill)
return false;
tsBufferPrefill = 0;
return true;
}
bool cIptvDevice::GetTSPacket(uchar *&Data) bool cIptvDevice::GetTSPacket(uchar *&Data)
{ {
int Count = 0; int Count = 0;
//debug("cIptvDevice::GetTSPacket(%d)\n", deviceIndex); //debug("cIptvDevice::GetTSPacket(%d)\n", deviceIndex);
if (tsBufferPrefill && tsBuffer->Available() < tsBufferPrefill)
return false;
else
tsBufferPrefill = 0;
if (isPacketDelivered) { if (isPacketDelivered) {
tsBuffer->Del(TS_SIZE); tsBuffer->Del(TS_SIZE);
isPacketDelivered = false; isPacketDelivered = false;

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.h,v 1.12 2007/09/20 21:15:08 rahrenbe Exp $ * $Id: device.h,v 1.13 2007/09/20 22:01:42 rahrenbe Exp $
*/ */
#ifndef __IPTV_DEVICE_H #ifndef __IPTV_DEVICE_H
@ -78,7 +78,12 @@ protected:
virtual bool GetTSPacket(uchar *&Data); virtual bool GetTSPacket(uchar *&Data);
// for section filtering // for section filtering
public:
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask); virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
// for transponder lock
public:
virtual bool HasLock(int);
}; };
#endif // __IPTV_DEVICE_H #endif // __IPTV_DEVICE_H