summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-09-08 09:36:16 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-09-08 09:36:16 +0200
commitf47655ef0f1836be0d92a7fa57e3c300922a81ee (patch)
tree76b8870093f4debcf6fec799dd829bbcf2fe0e0e /device.c
parentc792c552979366bf781c9d9c817487bdd2926189 (diff)
downloadvdr-f47655ef0f1836be0d92a7fa57e3c300922a81ee.tar.gz
vdr-f47655ef0f1836be0d92a7fa57e3c300922a81ee.tar.bz2
GetDevice() now prefers devices that are already receiving
Diffstat (limited to 'device.c')
-rw-r--r--device.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/device.c b/device.c
index ef662ce8..d7db99b3 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.16 2002/09/08 09:03:10 kls Exp $
+ * $Id: device.c 1.17 2002/09/08 09:36:16 kls Exp $
*/
#include "device.h"
@@ -126,9 +126,12 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDe
bool ndr;
if (device[i]->ProvidesChannel(Channel, Priority, &ndr) // this device is basicly able to do the job
&& (!d // we don't have a device yet, or...
- || device[i]->Priority() < d->Priority() // ...this one has an even lower Priority, or...
- || device[i]->Priority() == d->Priority() // ...same Priority...
- && device[i]->ProvidesCa(Channel->ca) < d->ProvidesCa(Channel->ca) // ...but this one provides fewer Ca values
+ || (device[i]->Receiving() && !ndr) // ...this one is already receiving and allows additional receivers, or...
+ || !d->Receiving() // ...the one we have is not receiving...
+ && (device[i]->Priority() < d->Priority() // ...this one has an even lower Priority, or...
+ || device[i]->Priority() == d->Priority() // ...same Priority...
+ && device[i]->ProvidesCa(Channel->ca) < d->ProvidesCa(Channel->ca) // ...but this one provides fewer Ca values
+ )
)
) {
d = device[i];