Prefer section pids.

This commit is contained in:
Rolf Ahrenberg 2016-12-16 00:39:41 +02:00
parent a5d57e9390
commit d26658a22e
3 changed files with 15 additions and 1 deletions

View File

@ -363,7 +363,7 @@ bool cSatipDevice::SetPid(cPidHandle *handleP, int typeP, bool onP)
if (pTunerM && handleP && handleP->pid >= 0) {
if (onP)
return pTunerM->SetPid(handleP->pid, typeP, true);
else if (!handleP->used)
else if (!handleP->used && pSectionFilterHandlerM && !pSectionFilterHandlerM->Exists(handleP->pid))
return pTunerM->SetPid(handleP->pid, typeP, false);
}
return true;

View File

@ -338,6 +338,19 @@ cString cSatipSectionFilterHandler::GetInformation(void)
return s;
}
bool cSatipSectionFilterHandler::Exists(u_short pidP)
{
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, pidP, deviceIndexM);
cMutexLock MutexLock(&mutexM);
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
if (filtersM[i] && (pidP == filtersM[i]->GetPid())) {
debug12("%s (%d) Found [device %d]", __PRETTY_FUNCTION__, pidP, deviceIndexM);
return true;
}
}
return false;
}
bool cSatipSectionFilterHandler::Delete(unsigned int indexP)
{
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, indexP, deviceIndexM);

View File

@ -80,6 +80,7 @@ public:
cSatipSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP);
virtual ~cSatipSectionFilterHandler();
cString GetInformation(void);
bool Exists(u_short pidP);
int Open(u_short pidP, u_char tidP, u_char maskP);
void Close(int handleP);
int GetPid(int handleP);