From 6d0f27e710fc6802b8c702e0d06258bdc3843c56 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Thu, 20 Sep 2007 22:01:42 +0000 Subject: [PATCH] Implemented HasLock() for prebuffering. --- device.c | 15 ++++++++++----- device.h | 7 ++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/device.c b/device.c index e516fb1..d8ce4ce 100644 --- a/device.c +++ b/device.c @@ -3,7 +3,7 @@ * * 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" @@ -248,14 +248,19 @@ void cIptvDevice::CloseDvr(void) 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) { int Count = 0; //debug("cIptvDevice::GetTSPacket(%d)\n", deviceIndex); - if (tsBufferPrefill && tsBuffer->Available() < tsBufferPrefill) - return false; - else - tsBufferPrefill = 0; if (isPacketDelivered) { tsBuffer->Del(TS_SIZE); isPacketDelivered = false; diff --git a/device.h b/device.h index f0285ae..7762ce6 100644 --- a/device.h +++ b/device.h @@ -3,7 +3,7 @@ * * 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 @@ -78,7 +78,12 @@ protected: virtual bool GetTSPacket(uchar *&Data); // for section filtering +public: virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask); + + // for transponder lock +public: + virtual bool HasLock(int); }; #endif // __IPTV_DEVICE_H