mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 11:37:42 +00:00
Apply vdr-satip_transfer-mode_fix.diff
Author: FireFly VDR-Portal thread: https://www.vdr-portal.de/forum/index.php?thread/135143-satip-plugin-patches/&postID=1350960#post1350960 Patch URL: https://www.vdr-portal.de/index.php?attachment/46673-vdr-satip-transfer-mode-fix-diff/
This commit is contained in:
parent
0a216f1cf9
commit
c723b48005
26
server.c
26
server.c
@ -40,29 +40,43 @@ bool cSatipFrontends::Matches(int deviceIdP, int transponderP)
|
||||
bool cSatipFrontends::Assign(int deviceIdP, int transponderP)
|
||||
{
|
||||
cSatipFrontend *tmp = NULL;
|
||||
// Prefer any unused one
|
||||
// Prefer any used one
|
||||
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
||||
if (!f->Attached() || (f->DeviceId() == deviceIdP)) {
|
||||
if (f->DeviceId() == deviceIdP) { // give deviceID priority, but take detached frontend if deviceID ist not yet attached
|
||||
tmp = f;
|
||||
break;
|
||||
}
|
||||
if (!f->Attached()) {
|
||||
tmp = f;
|
||||
}
|
||||
}
|
||||
if (tmp) {
|
||||
tmp->SetTransponder(transponderP);
|
||||
debug9("%s assigned TP %d to %s/#%d", __PRETTY_FUNCTION__, transponderP, *tmp->Description(), tmp->Index());
|
||||
return true;
|
||||
}
|
||||
error("no assignable frontend found [device %u]", deviceIdP);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cSatipFrontends::Attach(int deviceIdP, int transponderP)
|
||||
{
|
||||
cSatipFrontend *tmp = NULL;
|
||||
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
||||
if (f->Transponder() == transponderP) {
|
||||
f->Attach(deviceIdP);
|
||||
debug9("%s (%d, %d) %s/#%d", __PRETTY_FUNCTION__, deviceIdP, transponderP, *f->Description(), f->Index());
|
||||
return true;
|
||||
tmp = f;
|
||||
if (f->DeviceId() == deviceIdP) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp) {
|
||||
tmp->Attach(deviceIdP);
|
||||
debug9("%s attached deviceId %d (TP %d) to %s/#%d", __PRETTY_FUNCTION__, deviceIdP, transponderP, *tmp->Description(), tmp->Index());
|
||||
return true;
|
||||
}
|
||||
error("%s no Frontend found for attaching deviceID %d (TP %d)", __PRETTY_FUNCTION__, deviceIdP, transponderP);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -71,7 +85,7 @@ bool cSatipFrontends::Detach(int deviceIdP, int transponderP)
|
||||
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
||||
if (f->Transponder() == transponderP) {
|
||||
f->Detach(deviceIdP);
|
||||
debug9("%s (%d, %d) %s/#%d", __PRETTY_FUNCTION__, deviceIdP, transponderP, *f->Description(), f->Index());
|
||||
debug9("%s detached deviceID %d (TP %d) from %s/#%d", __PRETTY_FUNCTION__, deviceIdP, transponderP, *f->Description(), f->Index());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user