From 2c311093babab83b93dfdd64826b6a2e82462440 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 26 Oct 2002 09:43:11 +0200 Subject: Fixed checking the Ca() status of a cDevice --- device.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'device.c') 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; -- cgit v1.2.3