1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Changed PID handling for section handler PIDs

This commit is contained in:
REELcoder 2016-11-02 23:39:22 +01:00
parent 61b56db909
commit cf35c4b381
3 changed files with 19 additions and 8 deletions

View File

@ -372,9 +372,9 @@ bool cSatipDevice::SetPid(cPidHandle *handleP, int typeP, bool onP)
debug12("%s (%d, %d, %d) [device %u]", __PRETTY_FUNCTION__, handleP ? handleP->pid : -1, typeP, onP, deviceIndexM); debug12("%s (%d, %d, %d) [device %u]", __PRETTY_FUNCTION__, handleP ? handleP->pid : -1, typeP, onP, deviceIndexM);
if (pTunerM && handleP && handleP->pid >= 0) { if (pTunerM && handleP && handleP->pid >= 0) {
if (onP) if (onP)
return pTunerM->SetPid(handleP->pid, typeP, true); return pTunerM->SetPid(handleP->pid, typeP, true, true);
else if (!handleP->used) else if (!handleP->used)
return pTunerM->SetPid(handleP->pid, typeP, false); return pTunerM->SetPid(handleP->pid, typeP, false, true);
} }
return true; return true;
} }
@ -385,7 +385,7 @@ int cSatipDevice::OpenFilter(u_short pidP, u_char tidP, u_char maskP)
if (pSectionFilterHandlerM) { if (pSectionFilterHandlerM) {
int handle = pSectionFilterHandlerM->Open(pidP, tidP, maskP); int handle = pSectionFilterHandlerM->Open(pidP, tidP, maskP);
if (pTunerM && (handle >= 0)) if (pTunerM && (handle >= 0))
pTunerM->SetPid(pidP, ptOther, true); pTunerM->SetPid(pidP, ptOther, true, false);
return handle; return handle;
} }
return -1; return -1;
@ -397,7 +397,7 @@ void cSatipDevice::CloseFilter(int handleP)
int pid = pSectionFilterHandlerM->GetPid(handleP); int pid = pSectionFilterHandlerM->GetPid(handleP);
debug12("%s (%d) [device %u]", __PRETTY_FUNCTION__, pid, deviceIndexM); debug12("%s (%d) [device %u]", __PRETTY_FUNCTION__, pid, deviceIndexM);
if (pTunerM) if (pTunerM)
pTunerM->SetPid(pid, ptOther, false); pTunerM->SetPid(pid, ptOther, false, false);
pSectionFilterHandlerM->Close(handleP); pSectionFilterHandlerM->Close(handleP);
} }
} }
@ -549,6 +549,11 @@ bool cSatipDevice::GetTSPacket(uchar *&dataP)
} }
} }
dataP = GetData(); dataP = GetData();
if (dataP && (dataP[4] == 0x00) && (dataP[5] == 0x02) && ((dataP[6] & 0xf0) == 0xb0)) {
int pid = ((dataP[1] & 0x1f) << 8) | dataP[2];
debug12("%s PID %d 0x%02x%02x%02x%02x%02x%02x%02x", __PRETTY_FUNCTION__,
pid, dataP[0], dataP[1], dataP[2], dataP[3], dataP[4], dataP[5], dataP[6]);
}
return true; return true;
} }
dataP = NULL; dataP = NULL;

11
tuner.c
View File

@ -47,7 +47,8 @@ cSatipTuner::cSatipTuner(cSatipDeviceIf &deviceP, unsigned int packetLenP)
pmtPidM(-1), pmtPidM(-1),
addPidsM(), addPidsM(),
delPidsM(), delPidsM(),
pidsM() pidsM(),
fixedPidsM()
{ {
debug1("%s (, %d) [device %d]", __PRETTY_FUNCTION__, packetLenP, deviceIdM); debug1("%s (, %d) [device %d]", __PRETTY_FUNCTION__, packetLenP, deviceIdM);
@ -405,7 +406,7 @@ bool cSatipTuner::SetSource(cSatipServer *serverP, const int transponderP, const
return true; return true;
} }
bool cSatipTuner::SetPid(int pidP, int typeP, bool onP) bool cSatipTuner::SetPid(int pidP, int typeP, bool onP, bool fixedP)
{ {
debug16("%s (%d, %d, %d) [device %d]", __PRETTY_FUNCTION__, pidP, typeP, onP, deviceIdM); debug16("%s (%d, %d, %d) [device %d]", __PRETTY_FUNCTION__, pidP, typeP, onP, deviceIdM);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
@ -413,11 +414,14 @@ bool cSatipTuner::SetPid(int pidP, int typeP, bool onP)
pidsM.AddPid(pidP); pidsM.AddPid(pidP);
addPidsM.AddPid(pidP); addPidsM.AddPid(pidP);
delPidsM.RemovePid(pidP); delPidsM.RemovePid(pidP);
if (fixedP)
fixedPidsM.AddPid(pidP);
} }
else { else if (fixedP || fixedPidsM.IndexOf(pidP) == -1) {
pidsM.RemovePid(pidP); pidsM.RemovePid(pidP);
delPidsM.AddPid(pidP); delPidsM.AddPid(pidP);
addPidsM.RemovePid(pidP); addPidsM.RemovePid(pidP);
fixedPidsM.RemovePid(pidP);
} }
debug12("%s (%d, %d, %d) pids=%s [device %d]", __PRETTY_FUNCTION__, pidP, typeP, onP, *pidsM.ListPids(), deviceIdM); debug12("%s (%d, %d, %d) pids=%s [device %d]", __PRETTY_FUNCTION__, pidP, typeP, onP, *pidsM.ListPids(), deviceIdM);
sleepM.Signal(); sleepM.Signal();
@ -477,6 +481,7 @@ bool cSatipTuner::UpdatePids(bool forceP)
return false; return false;
addPidsM.Clear(); addPidsM.Clear();
delPidsM.Clear(); delPidsM.Clear();
fixedPidsM.Clear();
} }
return true; return true;

View File

@ -122,6 +122,7 @@ private:
cSatipPid addPidsM; cSatipPid addPidsM;
cSatipPid delPidsM; cSatipPid delPidsM;
cSatipPid pidsM; cSatipPid pidsM;
cSatipPid fixedPidsM;
bool Connect(void); bool Connect(void);
bool Disconnect(void); bool Disconnect(void);
@ -143,7 +144,7 @@ public:
virtual ~cSatipTuner(); virtual ~cSatipTuner();
bool IsTuned(void) const { return (currentStateM >= tsTuned); } bool IsTuned(void) const { return (currentStateM >= tsTuned); }
bool SetSource(cSatipServer *serverP, const int transponderP, const char *parameterP, const int indexP); bool SetSource(cSatipServer *serverP, const int transponderP, const char *parameterP, const int indexP);
bool SetPid(int pidP, int typeP, bool onP); bool SetPid(int pidP, int typeP, bool onP, bool fixedP = true);
bool Open(void); bool Open(void);
bool Close(void); bool Close(void);
int FrontendId(void); int FrontendId(void);