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:
parent
0f9e0014df
commit
db0c18ba33
42
server.c
42
server.c
@ -204,26 +204,6 @@ int cSatipServer::Compare(const cListObject &listObjectP) const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transponderP)
|
||||
{
|
||||
bool result = false;
|
||||
if (cSource::IsType(sourceP, 'S'))
|
||||
result = frontendsM[eSatipFrontendDVBS2].Assign(deviceIdP, transponderP);
|
||||
else if (cSource::IsType(sourceP, 'T')) {
|
||||
if (systemP)
|
||||
result = frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
||||
else
|
||||
result = frontendsM[eSatipFrontendDVBT].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
||||
}
|
||||
else if (cSource::IsType(sourceP, 'C')) {
|
||||
if (systemP)
|
||||
result = frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
||||
else
|
||||
result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool cSatipServer::IsValidSource(int sourceP)
|
||||
{
|
||||
if (sourceFiltersM[0]) {
|
||||
@ -237,6 +217,28 @@ bool cSatipServer::IsValidSource(int sourceP)
|
||||
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')) {
|
||||
if (systemP)
|
||||
result = frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
||||
else
|
||||
result = frontendsM[eSatipFrontendDVBT].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
||||
}
|
||||
else if (cSource::IsType(sourceP, 'C')) {
|
||||
if (systemP)
|
||||
result = frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
||||
else
|
||||
result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool cSatipServer::Matches(int sourceP)
|
||||
{
|
||||
if (IsValidSource(sourceP)) {
|
||||
|
Loading…
Reference in New Issue
Block a user