mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Fixed server reuse for active transponders.
This commit is contained in:
parent
c4d82eac36
commit
92b2c63f0d
3
HISTORY
3
HISTORY
@ -65,7 +65,8 @@ VDR Plugin 'satip' Revision History
|
|||||||
- Added a validity check for the session member.
|
- Added a validity check for the session member.
|
||||||
- Added a session id quirk for Triax TSS 400.
|
- Added a session id quirk for Triax TSS 400.
|
||||||
|
|
||||||
2014-xx-xx: Version 0.3.4
|
2014-11-01: Version 0.3.4
|
||||||
|
|
||||||
- Fixed the cable only device detection.
|
- Fixed the cable only device detection.
|
||||||
- Added support for blacklisted sources.
|
- Added support for blacklisted sources.
|
||||||
|
- Fixed server reuse for active transponders.
|
||||||
|
3
device.c
3
device.c
@ -288,11 +288,12 @@ bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cString address;
|
cString address;
|
||||||
cSatipServer *server = cSatipDiscover::GetInstance()->GetServer(channelP->Source(), dtp.System());
|
cSatipServer *server = cSatipDiscover::GetInstance()->GetServer(channelP->Source(), channelP->Transponder(), dtp.System());
|
||||||
if (!server) {
|
if (!server) {
|
||||||
debug("cSatipDevice::%s(%u): no suitable server found", __FUNCTION__, deviceIndexM);
|
debug("cSatipDevice::%s(%u): no suitable server found", __FUNCTION__, deviceIndexM);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
cSatipDiscover::GetInstance()->SetTransponder(server, channelP->Transponder());
|
||||||
if (pTunerM && pTunerM->SetSource(server, *params, deviceIndexM)) {
|
if (pTunerM && pTunerM->SetSource(server, *params, deviceIndexM)) {
|
||||||
deviceNameM = cString::sprintf("%s %d %s", *DeviceType(), deviceIndexM, *cSatipDiscover::GetInstance()->GetServerString(server));
|
deviceNameM = cString::sprintf("%s %d %s", *DeviceType(), deviceIndexM, *cSatipDiscover::GetInstance()->GetServerString(server));
|
||||||
channelM = *channelP;
|
channelM = *channelP;
|
||||||
|
22
discover.c
22
discover.c
@ -270,11 +270,11 @@ int cSatipDiscover::GetServerCount(void)
|
|||||||
return serversM ? serversM->Count() : -1;
|
return serversM ? serversM->Count() : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cSatipServer *cSatipDiscover::GetServer(int sourceP, int systemP)
|
cSatipServer *cSatipDiscover::GetServer(int sourceP, int transponderP, int systemP)
|
||||||
{
|
{
|
||||||
//debug("cSatipDiscover::%s(%d, %d)", __FUNCTION__, sourceP, systemP);
|
//debug("cSatipDiscover::%s(%d, %d, %d)", __FUNCTION__, sourceP, transponderP, systemP);
|
||||||
cMutexLock MutexLock(&mutexM);
|
cMutexLock MutexLock(&mutexM);
|
||||||
return serversM ? serversM->Find(sourceP, systemP) : NULL;
|
return serversM ? serversM->Find(sourceP, transponderP, systemP) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cSatipServer *cSatipDiscover::GetServer(cSatipServer *serverP)
|
cSatipServer *cSatipDiscover::GetServer(cSatipServer *serverP)
|
||||||
@ -293,21 +293,29 @@ cSatipServers *cSatipDiscover::GetServers(void)
|
|||||||
|
|
||||||
cString cSatipDiscover::GetServerString(cSatipServer *serverP)
|
cString cSatipDiscover::GetServerString(cSatipServer *serverP)
|
||||||
{
|
{
|
||||||
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
|
//debug("cSatipDiscover::%s()", __FUNCTION__);
|
||||||
cMutexLock MutexLock(&mutexM);
|
cMutexLock MutexLock(&mutexM);
|
||||||
return serversM ? serversM->GetString(serverP) : "";
|
return serversM ? serversM->GetString(serverP) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cSatipDiscover::GetServerList(void)
|
cString cSatipDiscover::GetServerList(void)
|
||||||
{
|
{
|
||||||
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
|
//debug("cSatipDiscover::%s()", __FUNCTION__);
|
||||||
cMutexLock MutexLock(&mutexM);
|
cMutexLock MutexLock(&mutexM);
|
||||||
return serversM ? serversM->List() : "";
|
return serversM ? serversM->List() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cSatipDiscover::SetTransponder(cSatipServer *serverP, int transponderP)
|
||||||
|
{
|
||||||
|
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, transponderP);
|
||||||
|
cMutexLock MutexLock(&mutexM);
|
||||||
|
if (serversM)
|
||||||
|
serversM->SetTransponder(serverP, transponderP);
|
||||||
|
}
|
||||||
|
|
||||||
void cSatipDiscover::UseServer(cSatipServer *serverP, bool onOffP)
|
void cSatipDiscover::UseServer(cSatipServer *serverP, bool onOffP)
|
||||||
{
|
{
|
||||||
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
|
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, onOffP);
|
||||||
cMutexLock MutexLock(&mutexM);
|
cMutexLock MutexLock(&mutexM);
|
||||||
if (serversM)
|
if (serversM)
|
||||||
serversM->Use(serverP, onOffP);
|
serversM->Use(serverP, onOffP);
|
||||||
@ -315,7 +323,7 @@ void cSatipDiscover::UseServer(cSatipServer *serverP, bool onOffP)
|
|||||||
|
|
||||||
int cSatipDiscover::NumProvidedSystems(void)
|
int cSatipDiscover::NumProvidedSystems(void)
|
||||||
{
|
{
|
||||||
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
|
//debug("cSatipDiscover::%s()", __FUNCTION__);
|
||||||
cMutexLock MutexLock(&mutexM);
|
cMutexLock MutexLock(&mutexM);
|
||||||
return serversM ? serversM->NumProvidedSystems() : 0;
|
return serversM ? serversM->NumProvidedSystems() : 0;
|
||||||
}
|
}
|
||||||
|
@ -57,10 +57,11 @@ public:
|
|||||||
virtual ~cSatipDiscover();
|
virtual ~cSatipDiscover();
|
||||||
void TriggerScan(void) { probeIntervalM.Set(0); }
|
void TriggerScan(void) { probeIntervalM.Set(0); }
|
||||||
int GetServerCount(void);
|
int GetServerCount(void);
|
||||||
cSatipServer *GetServer(int sourceP, int systemP = -1);
|
cSatipServer *GetServer(int sourceP, int transponderP = 0, int systemP = -1);
|
||||||
cSatipServer *GetServer(cSatipServer *serverP);
|
cSatipServer *GetServer(cSatipServer *serverP);
|
||||||
cSatipServers *GetServers(void);
|
cSatipServers *GetServers(void);
|
||||||
cString GetServerString(cSatipServer *serverP);
|
cString GetServerString(cSatipServer *serverP);
|
||||||
|
void SetTransponder(cSatipServer *serverP, int transponderP);
|
||||||
void UseServer(cSatipServer *serverP, bool onOffP);
|
void UseServer(cSatipServer *serverP, bool onOffP);
|
||||||
cString GetServerList(void);
|
cString GetServerList(void);
|
||||||
int NumProvidedSystems(void);
|
int NumProvidedSystems(void);
|
||||||
|
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
|
||||||
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
|
||||||
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
||||||
"Language-Team: Catalan <vdr@linuxtv.org>\n"
|
"Language-Team: Catalan <vdr@linuxtv.org>\n"
|
||||||
"Language: ca\n"
|
"Language: ca\n"
|
||||||
|
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
|
||||||
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
|
||||||
"Last-Translator: Frank Neumann <fnu@yavdr.org>\n"
|
"Last-Translator: Frank Neumann <fnu@yavdr.org>\n"
|
||||||
"Language-Team: German <vdr@linuxtv.org>\n"
|
"Language-Team: German <vdr@linuxtv.org>\n"
|
||||||
"Language: de\n"
|
"Language: de\n"
|
||||||
|
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
|
||||||
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
|
||||||
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
||||||
"Language-Team: Spanish <vdr@linuxtv.org>\n"
|
"Language-Team: Spanish <vdr@linuxtv.org>\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
|
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
|
||||||
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
|
||||||
"Last-Translator: Rolf Ahrenberg\n"
|
"Last-Translator: Rolf Ahrenberg\n"
|
||||||
"Language-Team: Finnish <vdr@linuxtv.org>\n"
|
"Language-Team: Finnish <vdr@linuxtv.org>\n"
|
||||||
"Language: fi\n"
|
"Language: fi\n"
|
||||||
|
28
server.c
28
server.c
@ -19,6 +19,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
|
|||||||
modelTypeM(eSatipModelTypeNone),
|
modelTypeM(eSatipModelTypeNone),
|
||||||
quirkM(eSatipQuirkNone),
|
quirkM(eSatipQuirkNone),
|
||||||
useCountM(0),
|
useCountM(0),
|
||||||
|
transponderM(0),
|
||||||
createdM(time(NULL)),
|
createdM(time(NULL)),
|
||||||
lastSeenM(0)
|
lastSeenM(0)
|
||||||
{
|
{
|
||||||
@ -34,7 +35,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
|
|||||||
strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400
|
strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400
|
||||||
)
|
)
|
||||||
quirkM |= eSatipQuirkSessionId;
|
quirkM |= eSatipQuirkSessionId;
|
||||||
// These devices contain a play (*pids) parameter bug:
|
// These devices contain a play (add/delpids) parameter bug:
|
||||||
if (strstr(*descriptionM, "fritzdvbc")) // Fritz!WLAN Repeater DVB-C
|
if (strstr(*descriptionM, "fritzdvbc")) // Fritz!WLAN Repeater DVB-C
|
||||||
quirkM |= eSatipQuirkPlayPids;
|
quirkM |= eSatipQuirkPlayPids;
|
||||||
}
|
}
|
||||||
@ -113,7 +114,7 @@ cSatipServer *cSatipServers::Find(cSatipServer *serverP)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cSatipServer *cSatipServers::Find(int sourceP, int systemP)
|
cSatipServer *cSatipServers::Find(int sourceP, int transponderP, int systemP)
|
||||||
{
|
{
|
||||||
cSatipServer *result = NULL;
|
cSatipServer *result = NULL;
|
||||||
int model = 0;
|
int model = 0;
|
||||||
@ -127,6 +128,10 @@ cSatipServer *cSatipServers::Find(int sourceP, int systemP)
|
|||||||
}
|
}
|
||||||
else if (cSource::IsType(sourceP, 'C'))
|
else if (cSource::IsType(sourceP, 'C'))
|
||||||
model |= cSatipServer::eSatipModelTypeDVBC;
|
model |= cSatipServer::eSatipModelTypeDVBC;
|
||||||
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
|
if (s->Match(model) && s->Used() && (s->Transponder() == transponderP))
|
||||||
|
return s;
|
||||||
|
}
|
||||||
for (cSatipServer *s = First(); s; s = Next(s)) {
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
if (s->Match(model)) {
|
if (s->Match(model)) {
|
||||||
result = s;
|
result = s;
|
||||||
@ -138,6 +143,16 @@ cSatipServer *cSatipServers::Find(int sourceP, int systemP)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cSatipServers::SetTransponder(cSatipServer *serverP, bool transponderP)
|
||||||
|
{
|
||||||
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
|
if (s == serverP) {
|
||||||
|
s->SetTransponder(transponderP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cSatipServer *cSatipServers::Update(cSatipServer *serverP)
|
cSatipServer *cSatipServers::Update(cSatipServer *serverP)
|
||||||
{
|
{
|
||||||
for (cSatipServer *s = First(); s; s = Next(s)) {
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
@ -193,10 +208,13 @@ int cSatipServers::NumProvidedSystems(void)
|
|||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (cSatipServer *s = First(); s; s = Next(s)) {
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
// DVB-S*: qpsk, 8psk
|
// DVB-S2: qpsk, 8psk, 16apsk, 32apsk
|
||||||
count += s->Satellite() * 4;
|
count += s->Satellite() * 4;
|
||||||
// DVB-T*: qpsk, qam16, qam64, qam256
|
// DVB-T2: qpsk, qam16, qam64, qam256
|
||||||
count += (s->Terrestrial2() ? s->Terrestrial2() : s->Terrestrial()) * 4;
|
// DVB-T: qpsk, qam16, qam64
|
||||||
|
count += s->Terrestrial2() ? s->Terrestrial2() * 4 : s->Terrestrial() * 3;
|
||||||
|
// DVB-C: qam64, qam128, qam256
|
||||||
|
count += s->Cable() * 3;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
6
server.h
6
server.h
@ -26,6 +26,7 @@ private:
|
|||||||
int modelTypeM;
|
int modelTypeM;
|
||||||
int quirkM;
|
int quirkM;
|
||||||
int useCountM;
|
int useCountM;
|
||||||
|
int transponderM;
|
||||||
time_t createdM;
|
time_t createdM;
|
||||||
cTimeMs lastSeenM;
|
cTimeMs lastSeenM;
|
||||||
|
|
||||||
@ -48,6 +49,8 @@ public:
|
|||||||
virtual ~cSatipServer();
|
virtual ~cSatipServer();
|
||||||
virtual int Compare(const cListObject &listObjectP) const;
|
virtual int Compare(const cListObject &listObjectP) const;
|
||||||
void Use(bool onOffP);
|
void Use(bool onOffP);
|
||||||
|
void SetTransponder(const int transponderP) { transponderM = transponderP; }
|
||||||
|
int Transponder(void) { return transponderM; }
|
||||||
bool Used(void) { return !!useCountM; }
|
bool Used(void) { return !!useCountM; }
|
||||||
const char *Description() { return *descriptionM; }
|
const char *Description() { return *descriptionM; }
|
||||||
const char *Address() { return *addressM; }
|
const char *Address() { return *addressM; }
|
||||||
@ -69,7 +72,8 @@ public:
|
|||||||
class cSatipServers : public cList<cSatipServer> {
|
class cSatipServers : public cList<cSatipServer> {
|
||||||
public:
|
public:
|
||||||
cSatipServer *Find(cSatipServer *serverP);
|
cSatipServer *Find(cSatipServer *serverP);
|
||||||
cSatipServer *Find(int sourceP, int systemP);
|
cSatipServer *Find(int sourceP, int transponderP, int systemP);
|
||||||
|
void SetTransponder(cSatipServer *serverP, bool transponderP);
|
||||||
cSatipServer *Update(cSatipServer *serverP);
|
cSatipServer *Update(cSatipServer *serverP);
|
||||||
void Use(cSatipServer *serverP, bool onOffP);
|
void Use(cSatipServer *serverP, bool onOffP);
|
||||||
void Cleanup(uint64_t intervalMsP = 0);
|
void Cleanup(uint64_t intervalMsP = 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user