summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2011-02-01 14:24:47 +0100
committerFrank Schmirler <vdr@schmirler.de>2011-02-01 14:24:47 +0100
commit3a2936a1408293361065d72c5f5cd491d9a7a60b (patch)
treed3ba937266436f4c325629ac07786e114e954fd4 /server
parent06d5418e4284f23c91fff546a4cb25eda279265a (diff)
downloadvdr-plugin-streamdev-3a2936a1408293361065d72c5f5cd491d9a7a60b.tar.gz
vdr-plugin-streamdev-3a2936a1408293361065d72c5f5cd491d9a7a60b.tar.bz2
updated copy of GetClippedNumProvidedSystems to the version used since VDR 1.7.15
Diffstat (limited to 'server')
-rw-r--r--server/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/connection.c b/server/connection.c
index 824ba97..78a023a 100644
--- a/server/connection.c
+++ b/server/connection.c
@@ -189,7 +189,7 @@ bool cServerConnection::Respond(const char *Message, bool Last, ...)
#if APIVERSNUM >= 10700
static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
{
- int MaxNumProvidedSystems = 1 << AvailableBits;
+ int MaxNumProvidedSystems = (1 << AvailableBits) - 1;
int NumProvidedSystems = Device->NumProvidedSystems();
if (NumProvidedSystems > MaxNumProvidedSystems) {
esyslog("ERROR: device %d supports %d modulation systems but cDevice::GetDevice() currently only supports %d delivery systems which should be fixed", Device->CardIndex() + 1, NumProvidedSystems, MaxNumProvidedSystems);
@@ -261,7 +261,7 @@ cDevice* cServerConnection::CheckDevice(const cChannel *Channel, int Priority, b
imp <<= 1; imp |= !device->Receiving() && (device != cTransferControl::ReceiverDevice() || device->IsPrimaryDevice()) || ndr; // use receiving devices if we don't need to detach existing receivers, but avoid primary device in local transfer mode
imp <<= 1; imp |= device->Receiving(); // avoid devices that are receiving
#if APIVERSNUM >= 10700
- imp <<= 2; imp |= GetClippedNumProvidedSystems(2, device) - 1; // avoid cards which support multiple delivery systems
+ imp <<= 4; imp |= GetClippedNumProvidedSystems(4, device) - 1; // avoid cards which support multiple delivery systems
#endif
imp <<= 1; imp |= device == cTransferControl::ReceiverDevice(); // avoid the Transfer Mode receiver device
imp <<= 8; imp |= min(max(device->Priority() + MAXPRIORITY, 0), 0xFF); // use the device with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)