diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-10-26 09:43:11 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-10-26 09:43:11 +0200 |
commit | 2c311093babab83b93dfdd64826b6a2e82462440 (patch) | |
tree | 96d0dde0a04ac9e4224691e8d7fb00eb44d5f295 /device.c | |
parent | 01ad12975c2a3657440a0b2614d570107998c275 (diff) | |
download | vdr-2c311093babab83b93dfdd64826b6a2e82462440.tar.gz vdr-2c311093babab83b93dfdd64826b6a2e82462440.tar.bz2 |
Fixed checking the Ca() status of a cDevice
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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; |