summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-10-26 09:43:11 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-10-26 09:43:11 +0200
commit2c311093babab83b93dfdd64826b6a2e82462440 (patch)
tree96d0dde0a04ac9e4224691e8d7fb00eb44d5f295 /device.c
parent01ad12975c2a3657440a0b2614d570107998c275 (diff)
downloadvdr-2c311093babab83b93dfdd64826b6a2e82462440.tar.gz
vdr-2c311093babab83b93dfdd64826b6a2e82462440.tar.bz2
Fixed checking the Ca() status of a cDevice
Diffstat (limited to 'device.c')
-rw-r--r--device.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/device.c b/device.c
index eccacaa3..c7e5b350 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.29 2002/10/20 16:05:51 kls Exp $
+ * $Id: device.c 1.30 2002/10/26 09:43:11 kls Exp $
*/
#include "device.h"
@@ -52,7 +52,6 @@ cDevice::cDevice(void)
for (int i = 0; i < MAXRECEIVERS; i++)
receiver[i] = NULL;
- ca = -1;
if (numDevices < MAXDEVICES) {
device[numDevices++] = this;
@@ -531,6 +530,16 @@ int cDevice::PlayAudio(const uchar *Data, int Length)
return -1;
}
+int cDevice::Ca(void) const
+{
+ int ca = 0;
+ for (int i = 0; i < MAXRECEIVERS; i++) {
+ if (receiver[i] && (ca = receiver[i]->ca) != 0)
+ break; // all receivers have the same ca
+ }
+ return ca;
+}
+
int cDevice::Priority(void) const
{
int priority = IsPrimaryDevice() ? Setup.PrimaryLimit - 1 : DEFAULTPRIORITY;