CAM access only for CA channels and no longer during replay

This commit is contained in:
Klaus Schmidinger 2003-03-23 15:20:00 +01:00
parent e76f985840
commit be06e04d55
5 changed files with 25 additions and 6 deletions

View File

@ -1987,3 +1987,9 @@ Video Disk Recorder Revision History
- Modified the EPG scanner to avoid CPU load peaks (thanks to Steffen Becker for
reporting this one).
- Fixed support for Viaccess CAMs (thanks to Axel Gruber for helping to debug this).
2003-03-23: Version 1.1.27
- The CAM is now accessed only if the current channel actually has a non-zero Ca
value, and CAM access is completely suppressed during replay, which avoids
problems in case the CAM is attached to the primary DVB device.

5
ci.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: ci.c 1.8 2003/03/16 22:32:47 kls Exp $
* $Id: ci.c 1.9 2003/03/23 15:18:40 kls Exp $
*/
/* XXX TODO
@ -1273,6 +1273,7 @@ void cCiCaPmt::AddCaDescriptor(int Length, uint8_t *Data)
cCiHandler::cCiHandler(int Fd, int NumSlots)
{
numSlots = NumSlots;
enabled = true;
for (int i = 0; i < MAX_CI_SESSION; i++)
sessions[i] = NULL;
tpl = new cCiTransportLayer(Fd, numSlots);
@ -1425,6 +1426,8 @@ int cCiHandler::CloseAllSessions(int Slot)
bool cCiHandler::Process(void)
{
if (!enabled)
return false;
bool result = true;
cMutexLock MutexLock(&mutex);
for (int Slot = 0; Slot < numSlots; Slot++) {

4
ci.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: ci.h 1.3 2003/02/16 10:55:21 kls Exp $
* $Id: ci.h 1.4 2003/03/23 15:18:40 kls Exp $
*/
#ifndef __CI_H
@ -80,6 +80,7 @@ class cCiHandler {
private:
cMutex mutex;
int numSlots;
bool enabled;
cCiSession *sessions[MAX_CI_SESSION];
cCiTransportLayer *tpl;
cCiTransportConnection *tc;
@ -95,6 +96,7 @@ private:
public:
~cCiHandler();
static cCiHandler *CreateCiHandler(const char *FileName);
void SetEnabled(bool Enabled) { enabled = Enabled; }
bool Process(void);
bool EnterMenu(int Slot);
cCiMenu *GetMenu(void);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.150 2003/03/09 10:01:02 kls Exp $
* $Id: config.h 1.151 2003/03/23 14:42:35 kls Exp $
*/
#ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "device.h"
#include "tools.h"
#define VDRVERSION "1.1.26"
#define VDRVERSION "1.1.27"
#define MAXPRIORITY 99
#define MAXLIFETIME 99

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbdevice.c 1.46 2003/02/16 15:10:39 kls Exp $
* $Id: dvbdevice.c 1.47 2003/03/23 15:18:40 kls Exp $
*/
#include "dvbdevice.h"
@ -263,7 +263,7 @@ void cDvbTuner::Action(void)
}
}
if (tunerStatus >= tsLocked) {
if (ciHandler) {
if (ciHandler && channel.Ca()) {
if (ciHandler->Process()) {
if (tunerStatus != tsCam) {//XXX TODO update in case the CA descriptors have changed
uchar buffer[2048];
@ -773,11 +773,15 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, false));
if (siProcessor)
siProcessor->SetStatus(true);
if (ciHandler)
ciHandler->SetEnabled(true);
break;
case pmAudioVideo:
case pmAudioOnlyBlack:
if (siProcessor)
siProcessor->SetStatus(false);
if (ciHandler)
ciHandler->SetEnabled(false);
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true));
CHECK(ioctl(fd_audio, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY));
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, PlayMode == pmAudioVideo));
@ -788,6 +792,8 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
case pmAudioOnly:
if (siProcessor)
siProcessor->SetStatus(false);
if (ciHandler)
ciHandler->SetEnabled(false);
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true));
CHECK(ioctl(fd_audio, AUDIO_STOP, true));
CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER));
@ -799,6 +805,8 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
case pmExtern_THIS_SHOULD_BE_AVOIDED:
if (siProcessor)
siProcessor->SetStatus(false);
if (ciHandler)
ciHandler->SetEnabled(false);
close(fd_video);
close(fd_audio);
fd_video = fd_audio = -1;