mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Fixed DeleteFilter() and commented some debug outputs.
This commit is contained in:
parent
49234919ea
commit
c03e69a64f
14
device.c
14
device.c
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: device.c,v 1.39 2007/09/24 17:20:58 rahrenbe Exp $
|
||||
* $Id: device.c,v 1.40 2007/09/24 21:25:53 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
@ -155,9 +155,10 @@ bool cIptvDevice::SetPid(cPidHandle *Handle, int Type, bool On)
|
||||
bool cIptvDevice::DeleteFilter(unsigned int Index)
|
||||
{
|
||||
if ((Index < eMaxSecFilterCount) && secfilters[Index]) {
|
||||
debug("cIptvDevice::DeleteFilter(%d) Index=%d\n", deviceIndex, Index);
|
||||
delete secfilters[Index];
|
||||
//debug("cIptvDevice::DeleteFilter(%d) Index=%d\n", deviceIndex, Index);
|
||||
cIptvSectionFilter *tmp = secfilters[Index];
|
||||
secfilters[Index] = NULL;
|
||||
delete tmp;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -168,7 +169,7 @@ int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask)
|
||||
// Search the next free filter slot
|
||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||
if (!secfilters[i]) {
|
||||
debug("cIptvDevice::OpenFilter(%d): Pid=%d Tid=%02X Mask=%02X Index=%d\n", deviceIndex, Pid, Tid, Mask, i);
|
||||
//debug("cIptvDevice::OpenFilter(%d): Pid=%d Tid=%02X Mask=%02X Index=%d\n", deviceIndex, Pid, Tid, Mask, i);
|
||||
secfilters[i] = new cIptvSectionFilter(i, deviceIndex, Pid, Tid, Mask);
|
||||
return secfilters[i]->GetReadDesc();
|
||||
}
|
||||
@ -179,11 +180,12 @@ int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask)
|
||||
|
||||
bool cIptvDevice::CloseFilter(int Handle)
|
||||
{
|
||||
debug("cIptvDevice::CloseFilter(%d): %d\n", deviceIndex, Handle);
|
||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||
if (secfilters[i] && Handle == secfilters[i]->GetReadDesc())
|
||||
if (secfilters[i] && (Handle == secfilters[i]->GetReadDesc())) {
|
||||
//debug("cIptvDevice::CloseFilter(%d): %d\n", deviceIndex, Handle);
|
||||
return DeleteFilter(i);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: sectionfilter.c,v 1.3 2007/09/24 17:20:58 rahrenbe Exp $
|
||||
* $Id: sectionfilter.c,v 1.4 2007/09/24 21:25:54 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#include "sectionfilter.h"
|
||||
@ -23,7 +23,7 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
|
||||
pid(Pid),
|
||||
id(Index)
|
||||
{
|
||||
debug("cIptvSectionFilter::cIptvSectionFilter(%d)\n", Index);
|
||||
//debug("cIptvSectionFilter::cIptvSectionFilter(%d)\n", Index);
|
||||
memset(secbuf_base, '\0', sizeof(secbuf_base));
|
||||
memset(filter_value, '\0', sizeof(filter_value));
|
||||
memset(filter_mask, '\0', sizeof(filter_mask));
|
||||
@ -64,7 +64,7 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
|
||||
|
||||
cIptvSectionFilter::~cIptvSectionFilter()
|
||||
{
|
||||
debug("cIptvSectionFilter::~cIptvSectionfilter(%d)\n", id);
|
||||
//debug("cIptvSectionFilter::~cIptvSectionfilter(%d)\n", id);
|
||||
close(fifoDescriptor);
|
||||
close(readDescriptor);
|
||||
unlink(pipeName);
|
||||
|
Loading…
Reference in New Issue
Block a user