Fixed checking the Ca() status of a cDevice

This commit is contained in:
Klaus Schmidinger 2002-10-26 09:43:11 +02:00
parent 01ad12975c
commit 2c311093ba
4 changed files with 16 additions and 6 deletions

View File

@ -154,6 +154,7 @@ Stefan Huelswitt <huels@iname.com>
be switched or has actually been switched successfully
for adding a missing StripAudioPackets() to cDvbPlayer::Action()
for improving skipping channels that are (currently) not available
for fixing checking the Ca() status of a cDevice
Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than

View File

@ -1633,3 +1633,4 @@ Video Disk Recorder Revision History
now be given either in MHz, kHz or Hz. The actual value given will be multiplied
by 1000 until it is larger than 1000000.
- Fixed skipping unavailable channels when zapping downwards.
- Fixed checking the Ca() status of a cDevice (thanks to Stefan Huelswitt).

View File

@ -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;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.h 1.23 2002/10/12 11:15:13 kls Exp $
* $Id: device.h 1.24 2002/10/26 09:35:20 kls Exp $
*/
#ifndef __DEVICE_H
@ -324,7 +324,6 @@ public:
private:
cReceiver *receiver[MAXRECEIVERS];
int ca;
int CanShift(int Ca, int Priority, int UsedCards = 0) const;
protected:
int Priority(void) const;
@ -344,8 +343,8 @@ protected:
// false in case of a non recoverable error, otherwise it returns true,
// even if Data is NULL.
public:
int Ca(void) const { return ca; }
// Returns the ca of the current receiving session.
int Ca(void) const;
// Returns the ca of the current receiving session(s).
bool Receiving(void) const;
// Returns true if we are currently receiving.
bool AttachReceiver(cReceiver *Receiver);