From ef7940059ae661fab89d82fcef96903a06923a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?= Date: Fri, 28 Sep 2007 14:49:10 +0000 Subject: [PATCH] Added method for Blacklisting filter settings. --- device.c | 23 ++++++++++++++++++++++- device.h | 3 ++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/device.c b/device.c index 5ffecfb..4a345f2 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.41 2007/09/26 19:49:35 rahrenbe Exp $ + * $Id: device.c,v 1.42 2007/09/28 14:49:10 ajhseppa Exp $ */ #include "common.h" @@ -170,8 +170,29 @@ bool cIptvDevice::DeleteFilter(unsigned int Index) return false; } +bool cIptvDevice::IsBlackListed(u_short Pid, u_char Tid, u_char Mask) +{ + //debug("cIptvDevice::IsBlackListed(%d) Pid=%d Tid=%02X Mask=%02X\n", deviceIndex, Pid, Tid, Mask); + + // Black list. Should maybe be configurable via plugin setup menu + switch(Pid) { + + case 0x14: // TDT pid + return true; + + default: + break; + } + + return false; +} + int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask) { + // Black-listing check, refuse certain filters + if (IsBlackListed(Pid, Tid, Mask)) + return -1; + // Search the next free filter slot for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) { if (!secfilters[i]) { diff --git a/device.h b/device.h index 5a949b8..85da431 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.18 2007/09/26 19:49:35 rahrenbe Exp $ + * $Id: device.h,v 1.19 2007/09/28 14:49:10 ajhseppa Exp $ */ #ifndef __IPTV_DEVICE_H @@ -55,6 +55,7 @@ private: void ResetBuffering(void); bool IsBuffering(void); bool DeleteFilter(unsigned int Index); + bool IsBlackListed(u_short Pid, u_char Tid, u_char Mask); // for channel selection public: