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

Modified the model detection a bit more readable.

This commit is contained in:
Rolf Ahrenberg 2015-01-14 20:34:12 +02:00
parent aed5a7820a
commit 266aadb999
2 changed files with 15 additions and 21 deletions

View File

@ -326,7 +326,7 @@ bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
cString address; cString address;
cSatipServer *server = cSatipDiscover::GetInstance()->GetServer(channelP->Source(), channelP->Transponder(), dtp.System()); cSatipServer *server = cSatipDiscover::GetInstance()->GetServer(channelP->Source(), channelP->Transponder(), dtp.System());
if (!server) { if (!server) {
debug1("%s No suitable server found [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug9("%s No suitable server found [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return false; return false;
} }
cSatipDiscover::GetInstance()->SetTransponder(server, channelP->Transponder()); cSatipDiscover::GetInstance()->SetTransponder(server, channelP->Transponder());

View File

@ -52,40 +52,34 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
char *s, *p = strdup(*modelM); char *s, *p = strdup(*modelM);
char *r = strtok_r(p, ",", &s); char *r = strtok_r(p, ",", &s);
while (r) { while (r) {
if (strstr(r, "DVBS2")) { if (strstr(r, "DVBS2-")) {
modelTypeM |= cSatipServer::eSatipModelTypeDVBS2; modelTypeM |= eSatipModelTypeDVBS2;
if (char *c = strstr(r, "-")) if (char *c = strstr(r, "-"))
modelCountM[eSatipModuleDVBS2] = atoi(++c); modelCountM[eSatipModuleDVBS2] = atoi(++c);
else
modelCountM[eSatipModuleDVBS2] = 1;
} }
if (strstr(r, "DVBT2")) { else if (strstr(r, "DVBT2-")) {
modelTypeM |= cSatipServer::eSatipModelTypeDVBT2; modelTypeM |= eSatipModelTypeDVBT2;
if (char *c = strstr(r, "-")) if (char *c = strstr(r, "-"))
modelCountM[eSatipModuleDVBT2] = atoi(++c); modelCountM[eSatipModuleDVBT2] = atoi(++c);
else modelTypeM |= eSatipModelTypeDVBT;
modelCountM[eSatipModuleDVBT2] = 1; modelCountM[eSatipModuleDVBT] = modelCountM[eSatipModuleDVBT2];
} }
if (strstr(r, "DVBT")) { else if (strstr(r, "DVBT-")) {
modelTypeM |= cSatipServer::eSatipModelTypeDVBT; modelTypeM |= eSatipModelTypeDVBT;
if (char *c = strstr(r, "-")) if (char *c = strstr(r, "-"))
modelCountM[eSatipModuleDVBT] = atoi(++c); modelCountM[eSatipModuleDVBT] = atoi(++c);
else
modelCountM[eSatipModuleDVBT] = 1;
} }
if (strstr(r, "DVBC2")) { else if (strstr(r, "DVBC2-")) {
modelTypeM |= cSatipServer::eSatipModelTypeDVBC2; modelTypeM |= eSatipModelTypeDVBC2;
if (char *c = strstr(r, "-")) if (char *c = strstr(r, "-"))
modelCountM[eSatipModuleDVBC2] = atoi(++c); modelCountM[eSatipModuleDVBC2] = atoi(++c);
else modelTypeM |= eSatipModelTypeDVBC;
modelCountM[eSatipModuleDVBC2] = 1; modelCountM[eSatipModuleDVBC] = modelCountM[eSatipModuleDVBC2];
} }
if (strstr(r, "DVBC")) { else if (strstr(r, "DVBC-")) {
modelTypeM |= cSatipServer::eSatipModelTypeDVBC; modelTypeM |= eSatipModelTypeDVBC;
if (char *c = strstr(r, "-")) if (char *c = strstr(r, "-"))
modelCountM[eSatipModuleDVBC] = atoi(++c); modelCountM[eSatipModuleDVBC] = atoi(++c);
else
modelCountM[eSatipModuleDVBC] = 1;
} }
r = strtok_r(NULL, ",", &s); r = strtok_r(NULL, ",", &s);
} }