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

Check source validity also in server assign (Thanks to Patrick Boettcher).

This commit is contained in:
Rolf Ahrenberg 2016-07-31 12:00:55 +03:00
parent c2fe2b748d
commit 7a84ba78c8

View File

@ -204,9 +204,23 @@ int cSatipServer::Compare(const cListObject &listObjectP) const
return result;
}
bool cSatipServer::IsValidSource(int sourceP)
{
if (sourceFiltersM[0]) {
for (unsigned int i = 0; i < ELEMENTS(sourceFiltersM); ++i) {
if (sourceP == sourceFiltersM[i]) {
return true;
}
}
return false;
}
return true;
}
bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transponderP)
{
bool result = false;
if (IsValidSource(sourceP)) {
if (cSource::IsType(sourceP, 'S'))
result = frontendsM[eSatipFrontendDVBS2].Assign(deviceIdP, transponderP);
else if (cSource::IsType(sourceP, 'T')) {
@ -221,22 +235,10 @@ bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transpond
else
result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
}
}
return result;
}
bool cSatipServer::IsValidSource(int sourceP)
{
if (sourceFiltersM[0]) {
for (unsigned int i = 0; i < ELEMENTS(sourceFiltersM); ++i) {
if (sourceP == sourceFiltersM[i]) {
return true;
}
}
return false;
}
return true;
}
bool cSatipServer::Matches(int sourceP)
{
if (IsValidSource(sourceP)) {