summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-05-28 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-05-28 18:00:00 +0200
commit177b875945e5898ebc07d79527e0ddc5e4e0f93d (patch)
tree2227730ee8d6e28c918b8fdb59f8c4a680ed12d0 /device.c
parent5d8e3b18dc610e2696606092ba66e1477eccce88 (diff)
downloadvdr-patch-lnbsharing-177b875945e5898ebc07d79527e0ddc5e4e0f93d.tar.gz
vdr-patch-lnbsharing-177b875945e5898ebc07d79527e0ddc5e4e0f93d.tar.bz2
Version 1.4.0-2vdr-1.4.0-2
- Removed leftover LSMOD=... line from 'runvdr'. - Modified the Makefile to copy additional libraries a plugin might provide (suggested by Wayne Keer). See PLUGINS.html for details. - Fixed handling Transfer Mode when replaying Dolby Digital audio and the option '-a' was given (based on a patch from Werner Fink). To avoid having to increment the API version, several #if checks have been introduced around this. These will be removed once the API version actually needs to be incremented. - Fixed deleting the 'skinDescriptions' in cMenuSetupOSD::~cMenuSetupOSD() (thanks to Tobias Grimm). - Fixed calculating the start time of repeated timers with "first day" (thanks to Udo Richter). - Now setting a timer's cached start time to 0 after a call to Skip() (thanks to Udo Richter). - Fixed handling the running status of EPG events in case the "Schedule" menu is currently open (i.e. a write lock on the schedules data can't be achieved). - Fixed handling VPS timers in case the EPG event hasn't been 'seen' in a while. - Fixed calculating the cache size in cUnbufferedFile::Read() (thanks to Artur Skawina). - Removed -fPIC from VDR's and libsi's Makefile (suggested by Prakash Punnoor). - Modifed the device selection to better handle timer conflicts (reported by Christian Wieninger). - Avoiding a compiler warning in libsi's TypeLoop::operator[]. - Now processing the "frequency list descriptor" (based on a patch from Anssi Hannula). - Improved the repeat function for LIRC remote controls (thanks to Joerg Riechardt). - Fixed moving channels, which sometimes stopped the current replay session (reported by Mirko Dölle). - Fixed deleting channels in case the current channel's number changes (reported by Mirko Dölle).
Diffstat (limited to 'device.c')
-rw-r--r--device.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/device.c b/device.c
index 14b8817..7d0fe12 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.128 2006/04/14 14:34:43 kls Exp $
+ * $Id: device.c 1.130 2006/05/27 11:14:42 kls Exp $
*/
#include "device.h"
@@ -281,32 +281,20 @@ cDevice *cDevice::GetDevice(int Index)
cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers)
{
cDevice *d = NULL;
- int select = INT_MAX;
-
+ uint Impact = 0xFFFFFFFF;
for (int i = 0; i < numDevices; i++) {
bool ndr;
if (device[i]->ProvidesChannel(Channel, Priority, &ndr)) { // this device is basicly able to do the job
- int pri;
- if (device[i]->Receiving() && !ndr)
- pri = 0; // receiving and allows additional receivers
- else if (!device[i]->Receiving(true) && d && device[i]->ProvidesCa(Channel) < d->ProvidesCa(Channel))
- pri = 1; // free and fewer Ca's
- else if (!device[i]->Receiving() && !device[i]->HasDecoder())
- pri = 2; // free and not a full featured card
- else if (!device[i]->Receiving() && device[i] != ActualDevice())
- pri = 3; // free and not the actual device
- else if (!device[i]->Receiving() && !device[i]->IsPrimaryDevice())
- pri = 4; // free and not the primary device
- else if (!device[i]->Receiving())
- pri = 5; // free
- else if (d && device[i]->Priority() < d->Priority())
- pri = 6; // receiving but priority is lower
- else if (d && device[i]->Priority() == d->Priority() && device[i]->ProvidesCa(Channel) < d->ProvidesCa(Channel))
- pri = 7; // receiving with same priority but fewer Ca's
- else
- pri = 8; // all others
- if (pri <= select) {
- select = pri;
+ uint imp = 0;
+ imp <<= 1; imp |= !device[i]->Receiving() || ndr;
+ imp <<= 1; imp |= device[i]->Receiving();
+ imp <<= 1; imp |= device[i] == ActualDevice();
+ imp <<= 1; imp |= device[i]->IsPrimaryDevice();
+ imp <<= 1; imp |= device[i]->HasDecoder();
+ imp <<= 8; imp |= min(max(device[i]->Priority() + MAXPRIORITY, 0), 0xFF);
+ imp <<= 8; imp |= min(max(device[i]->ProvidesCa(Channel), 0), 0xFF);
+ if (imp < Impact) {
+ Impact = imp;
d = device[i];
if (NeedsDetachReceivers)
*NeedsDetachReceivers = ndr;
@@ -613,7 +601,7 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
StopReplay();
// If this card is switched to an other transponder, any receivers still
- // attached to it ineed to be automatically detached:
+ // attached to it need to be automatically detached:
bool NeedsDetachReceivers = false;
// If this card can't receive this channel, we must not actually switch