summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-06 12:32:38 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-06 12:32:38 +0100
commit61e420bdf6159af3c31023ae2230f6743cf6d8d3 (patch)
tree2d120ffeb4e50bd5ad7f10d025ee401fbe497793 /device.c
parenta57acf570d87e383fd6d89b2ac80087152792d2e (diff)
downloadvdr-61e420bdf6159af3c31023ae2230f6743cf6d8d3.tar.gz
vdr-61e420bdf6159af3c31023ae2230f6743cf6d8d3.tar.bz2
Fixed switching devices to the transponders of VPS recordings in case there are only bonded devices
Diffstat (limited to 'device.c')
-rw-r--r--device.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/device.c b/device.c
index 663f91ad..0452edc1 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 2.55 2012/03/03 11:43:05 kls Exp $
+ * $Id: device.c 2.56 2012/03/06 12:32:38 kls Exp $
*/
#include "device.h"
@@ -68,7 +68,6 @@ int cDevice::nextCardIndex = 0;
int cDevice::currentChannel = 1;
cDevice *cDevice::device[MAXDEVICES] = { NULL };
cDevice *cDevice::primaryDevice = NULL;
-cDevice *cDevice::avoidDevice = NULL;
cList<cDeviceHook> cDevice::deviceHooks;
cDevice::cDevice(void)
@@ -228,8 +227,6 @@ static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView, bool Query)
{
- cDevice *AvoidDevice = avoidDevice;
- avoidDevice = NULL;
// Collect the current priorities of all CAM slots that can decrypt the channel:
int NumCamSlots = CamSlots.Count();
int SlotPriority[NumCamSlots];
@@ -259,8 +256,6 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
if (NumUsableSlots && SlotPriority[j] > MAXPRIORITY)
continue; // there is no CAM available in this slot
for (int i = 0; i < numDevices; i++) {
- if (device[i] == AvoidDevice)
- continue; // this device shall be temporarily avoided
if (Channel->Ca() && Channel->Ca() <= CA_DVB_MAX && Channel->Ca() != device[i]->CardIndex() + 1)
continue; // a specific card was requested, but not this one
if (NumUsableSlots && !CamSlots.Get(j)->Assign(device[i], true))
@@ -319,6 +314,26 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
return d;
}
+cDevice *cDevice::GetDeviceForTransponder(const cChannel *Channel, int Priority)
+{
+ cDevice *Device = NULL;
+ for (int i = 0; i < cDevice::NumDevices(); i++) {
+ if (cDevice *d = cDevice::GetDevice(i)) {
+ if (d->IsTunedToTransponder(Channel))
+ return d; // if any device is tuned to the transponder, we're done
+ if (d->ProvidesTransponder(Channel)) {
+ if (d->MaySwitchTransponder(Channel))
+ Device = d; // this device may switch to the transponder without disturbing any receiver or live view
+ else if (!d->Occupied()) {
+ if (d->Priority() < Priority && (!Device || d->Priority() < Device->Priority()))
+ Device = d; // use this one only if no other with less impact can be found
+ }
+ }
+ }
+ }
+ return Device;
+}
+
bool cDevice::HasCi(void)
{
return false;