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

Merge commit '72a5ad34fb05ebd985465f998ad8d36a341c8ed6' into datathread

Conflicts:
	tuner.c
	tuner.h
This commit is contained in:
nafets227 2014-11-09 18:10:08 +01:00
commit bf9969f23a
2 changed files with 35 additions and 9 deletions

12
tuner.c
View File

@ -398,14 +398,14 @@ bool cSatipTuner::SetPid(int pidP, int typeP, bool onP)
cMutexLock MutexLock(&mutexM);
if (onP) {
pidsM.AppendUnique(pidP);
addPidsM.AppendUnique(pidP);
delPidsM.RemoveElement(pidP);
pidsM.AddPid(pidP);
addPidsM.AddPid(pidP);
delPidsM.RemovePid(pidP);
}
else {
pidsM.RemoveElement(pidP);
delPidsM.AppendUnique(pidP);
addPidsM.RemoveElement(pidP);
pidsM.RemovePid(pidP);
delPidsM.AddPid(pidP);
addPidsM.RemovePid(pidP);
}
pidUpdateCacheM.Set(ePidUpdateIntervalMs);

32
tuner.h
View File

@ -17,6 +17,32 @@
#include "socket.h"
#include "data.h"
class cSatipPid : public cVector<int> {
private:
int PidIndex(const int &pidP)
{
for (int i = 0; i < this->Size(); ++i) {
if (pidP == this->At(i))
return i;
}
return -1;
}
public:
void RemovePid(const int &pidP)
{
int i = PidIndex(pidP);
if (i >= 0)
this->Remove(i);
}
void AddPid(int pidP)
{
if (PidIndex(pidP) < 0)
this->Append(pidP);
}
};
class cSatipTuner : public cThread, public cSatipTunerStatistics {
private:
enum {
@ -58,9 +84,9 @@ private:
int signalStrengthM;
int signalQualityM;
int streamIdM;
cSatipVector<int> addPidsM;
cSatipVector<int> delPidsM;
cSatipVector<int> pidsM;
cSatipPid addPidsM;
cSatipPid delPidsM;
cSatipPid pidsM;
bool Connect(void);
bool Disconnect(void);