summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2008-01-27 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2008-01-27 18:00:00 +0100
commite3887083391d10f8cfcd1d8ac65a99d9978f05f2 (patch)
tree85d1b5e0ef75b718143b58184c56c6c8425a1d69 /device.c
parentfc4c8740a72e6c7cea5a001e19fdacb63c3cc538 (diff)
downloadvdr-patch-lnbsharing-e3887083391d10f8cfcd1d8ac65a99d9978f05f2.tar.gz
vdr-patch-lnbsharing-e3887083391d10f8cfcd1d8ac65a99d9978f05f2.tar.bz2
Version 1.5.14vdr-1.5.14
- Fixed the Play function in the pictures plugin. - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Updated the Makefile of the skincurses plugin (thanks to Rolf Ahrenberg). - The new option --localedir can be used to set the locale directory at runtime (based on a patch from Stefan Huelswitt). - Fixed finding new transponders (thanks to Winfried Köhler). - Implemented handling of DVB-S2 (thanks to Marco Schlüßler and Reinhard Nissl for a patch that was used to implement this). VDR now requires the "multiproto" DVB driver, e.g. from http://jusst.de/hg/multiproto. - Removed switching to the next higher or lower channel if the current channel is not available, in order to allow staying on an encrypted channel that takes a while for the CAM to start decrypting.
Diffstat (limited to 'device.c')
-rw-r--r--device.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/device.c b/device.c
index 84473af..e1c654d 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.148 2007/11/17 15:39:28 kls Exp $
+ * $Id: device.c 1.149 2008/01/27 10:40:46 kls Exp $
*/
#include "device.h"
@@ -359,6 +359,21 @@ cDevice *cDevice::GetDevice(int Index)
return (0 <= Index && Index < numDevices) ? device[Index] : NULL;
}
+static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
+{
+ int MaxNumProvidedSystems = 1 << AvailableBits;
+ 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);
+ NumProvidedSystems = MaxNumProvidedSystems;
+ }
+ else if (NumProvidedSystems <= 0) {
+ esyslog("ERROR: device %d reported an invalid number (%d) of supported delivery systems - assuming 1", Device->CardIndex() + 1, NumProvidedSystems);
+ NumProvidedSystems = 1;
+ }
+ return NumProvidedSystems;
+}
+
cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView)
{
// Collect the current priorities of all CAM slots that can decrypt the channel:
@@ -408,6 +423,7 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
imp <<= 1; imp |= LiveView ? !device[i]->IsPrimaryDevice() || ndr : 0; // prefer the primary device for live viewing if we don't need to detach existing receivers
imp <<= 1; imp |= !device[i]->Receiving() && (device[i] != cTransferControl::ReceiverDevice() || device[i]->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[i]->Receiving(); // avoid devices that are receiving
+ imp <<= 2; imp |= GetClippedNumProvidedSystems(2, device[i]) - 1; // avoid cards which support multiple delivery systems
imp <<= 1; imp |= device[i] == cTransferControl::ReceiverDevice(); // avoid the Transfer Mode receiver device
imp <<= 8; imp |= min(max(device[i]->Priority() + MAXPRIORITY, 0), 0xFF); // use the device with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)
imp <<= 8; imp |= min(max((NumUsableSlots ? SlotPriority[j] : 0) + MAXPRIORITY, 0), 0xFF); // use the CAM slot with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)
@@ -696,6 +712,11 @@ bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Needs
return false;
}
+int cDevice::NumProvidedSystems(void) const
+{
+ return 0;
+}
+
bool cDevice::IsTunedToTransponder(const cChannel *Channel)
{
return false;