mirror of
				https://github.com/rofafor/vdr-plugin-iptv.git
				synced 2023-10-10 11:37:03 +00:00 
			
		
		
		
	Fixed DeleteFilter() and commented some debug outputs.
This commit is contained in:
		
							
								
								
									
										14
									
								
								device.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								device.c
									
									
									
									
									
								
							@@ -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.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"
 | 
					#include "common.h"
 | 
				
			||||||
@@ -155,9 +155,10 @@ bool cIptvDevice::SetPid(cPidHandle *Handle, int Type, bool On)
 | 
				
			|||||||
bool cIptvDevice::DeleteFilter(unsigned int Index)
 | 
					bool cIptvDevice::DeleteFilter(unsigned int Index)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  if ((Index < eMaxSecFilterCount) && secfilters[Index]) {
 | 
					  if ((Index < eMaxSecFilterCount) && secfilters[Index]) {
 | 
				
			||||||
     debug("cIptvDevice::DeleteFilter(%d) Index=%d\n", deviceIndex, Index);
 | 
					     //debug("cIptvDevice::DeleteFilter(%d) Index=%d\n", deviceIndex, Index);
 | 
				
			||||||
     delete secfilters[Index];
 | 
					     cIptvSectionFilter *tmp = secfilters[Index];
 | 
				
			||||||
     secfilters[Index] = NULL;
 | 
					     secfilters[Index] = NULL;
 | 
				
			||||||
 | 
					     delete tmp;
 | 
				
			||||||
     return true;
 | 
					     return true;
 | 
				
			||||||
     }
 | 
					     }
 | 
				
			||||||
  return false;
 | 
					  return false;
 | 
				
			||||||
@@ -168,7 +169,7 @@ int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask)
 | 
				
			|||||||
  // Search the next free filter slot
 | 
					  // Search the next free filter slot
 | 
				
			||||||
  for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
 | 
					  for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
 | 
				
			||||||
      if (!secfilters[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);
 | 
					         secfilters[i] = new cIptvSectionFilter(i, deviceIndex, Pid, Tid, Mask);
 | 
				
			||||||
         return secfilters[i]->GetReadDesc();
 | 
					         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)
 | 
					bool cIptvDevice::CloseFilter(int Handle)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  debug("cIptvDevice::CloseFilter(%d): %d\n", deviceIndex, Handle);
 | 
					 | 
				
			||||||
  for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
 | 
					  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 DeleteFilter(i);
 | 
				
			||||||
         }
 | 
					         }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
  return false;
 | 
					  return false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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: 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"
 | 
					#include "sectionfilter.h"
 | 
				
			||||||
@@ -23,7 +23,7 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
 | 
				
			|||||||
  pid(Pid),
 | 
					  pid(Pid),
 | 
				
			||||||
  id(Index)
 | 
					  id(Index)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  debug("cIptvSectionFilter::cIptvSectionFilter(%d)\n", Index);
 | 
					  //debug("cIptvSectionFilter::cIptvSectionFilter(%d)\n", Index);
 | 
				
			||||||
  memset(secbuf_base, '\0', sizeof(secbuf_base));
 | 
					  memset(secbuf_base, '\0', sizeof(secbuf_base));
 | 
				
			||||||
  memset(filter_value, '\0', sizeof(filter_value));
 | 
					  memset(filter_value, '\0', sizeof(filter_value));
 | 
				
			||||||
  memset(filter_mask, '\0', sizeof(filter_mask));
 | 
					  memset(filter_mask, '\0', sizeof(filter_mask));
 | 
				
			||||||
@@ -64,7 +64,7 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
cIptvSectionFilter::~cIptvSectionFilter()
 | 
					cIptvSectionFilter::~cIptvSectionFilter()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  debug("cIptvSectionFilter::~cIptvSectionfilter(%d)\n", id);
 | 
					  //debug("cIptvSectionFilter::~cIptvSectionfilter(%d)\n", id);
 | 
				
			||||||
  close(fifoDescriptor);
 | 
					  close(fifoDescriptor);
 | 
				
			||||||
  close(readDescriptor);
 | 
					  close(readDescriptor);
 | 
				
			||||||
  unlink(pipeName);
 | 
					  unlink(pipeName);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user