1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

The DVB devices no longer send CA descriptors to the CAM while the EPG scanner is active

This commit is contained in:
Klaus Schmidinger 2003-09-06 13:22:24 +02:00
parent 6d677e2a89
commit ee10028dc6
4 changed files with 19 additions and 7 deletions

View File

@ -2372,3 +2372,6 @@ Video Disk Recorder Revision History
- When setting an editing mark while in "Pause" mode, replay now immediately - When setting an editing mark while in "Pause" mode, replay now immediately
jumps to the marked frame (thanks to Oskar Signell for pointing out this jumps to the marked frame (thanks to Oskar Signell for pointing out this
problem). problem).
- The DVB devices no longer send CA descriptors to the CAM while the EPG scanner
is active (sometimes the CAMs got irritated when the device tuned to channels
they couldn't handle).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbdevice.c 1.63 2003/08/30 11:40:41 kls Exp $ * $Id: dvbdevice.c 1.64 2003/09/06 13:19:33 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -74,6 +74,7 @@ private:
cChannel channel; cChannel channel;
const char *diseqcCommands; const char *diseqcCommands;
bool active; bool active;
bool useCa;
time_t startTime; time_t startTime;
eTunerStatus tunerStatus; eTunerStatus tunerStatus;
cMutex mutex; cMutex mutex;
@ -84,7 +85,7 @@ public:
cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCiHandler *CiHandler); cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCiHandler *CiHandler);
virtual ~cDvbTuner(); virtual ~cDvbTuner();
bool IsTunedTo(const cChannel *Channel) const; bool IsTunedTo(const cChannel *Channel) const;
void Set(const cChannel *Channel, bool Tune); void Set(const cChannel *Channel, bool Tune, bool UseCa);
bool Locked(void) { return tunerStatus == tsLocked; } bool Locked(void) { return tunerStatus == tsLocked; }
}; };
@ -96,6 +97,7 @@ cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCi
ciHandler = CiHandler; ciHandler = CiHandler;
diseqcCommands = NULL; diseqcCommands = NULL;
active = false; active = false;
useCa = false;
tunerStatus = tsIdle; tunerStatus = tsIdle;
startTime = time(NULL); startTime = time(NULL);
Start(); Start();
@ -114,7 +116,7 @@ bool cDvbTuner::IsTunedTo(const cChannel *Channel) const
return tunerStatus != tsIdle && channel.Source() == Channel->Source() && channel.Frequency() == Channel->Frequency(); return tunerStatus != tsIdle && channel.Source() == Channel->Source() && channel.Frequency() == Channel->Frequency();
} }
void cDvbTuner::Set(const cChannel *Channel, bool Tune) void cDvbTuner::Set(const cChannel *Channel, bool Tune, bool UseCa)
{ {
cMutexLock MutexLock(&mutex); cMutexLock MutexLock(&mutex);
bool CaChange = !(Channel->GetChannelID() == channel.GetChannelID()); bool CaChange = !(Channel->GetChannelID() == channel.GetChannelID());
@ -122,6 +124,7 @@ void cDvbTuner::Set(const cChannel *Channel, bool Tune)
tunerStatus = tsSet; tunerStatus = tsSet;
else if (tunerStatus == tsCam && CaChange) else if (tunerStatus == tsCam && CaChange)
tunerStatus = tsTuned; tunerStatus = tsTuned;
useCa = UseCa;
if (Channel->Ca() && CaChange) if (Channel->Ca() && CaChange)
startTime = time(NULL); startTime = time(NULL);
channel = *Channel; channel = *Channel;
@ -267,7 +270,7 @@ void cDvbTuner::Action(void)
} }
if (tunerStatus >= tsLocked) { if (tunerStatus >= tsLocked) {
if (ciHandler) { if (ciHandler) {
if (ciHandler->Process()) { if (ciHandler->Process() && useCa) {
if (tunerStatus != tsCam) {//XXX TODO update in case the CA descriptors have changed if (tunerStatus != tsCam) {//XXX TODO update in case the CA descriptors have changed
for (int Slot = 0; Slot < ciHandler->NumSlots(); Slot++) { for (int Slot = 0; Slot < ciHandler->NumSlots(); Slot++) {
uchar buffer[2048]; uchar buffer[2048];
@ -673,6 +676,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
StartTransferMode = false; StartTransferMode = false;
#endif #endif
// XXX 1.3: use the same mechanism as below (!EITScanner.UsesDevice(this))
if (EITScanner.Active()) { if (EITScanner.Active()) {
StartTransferMode = false; StartTransferMode = false;
TurnOnLivePIDs = false; TurnOnLivePIDs = false;
@ -690,7 +694,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (TurnOffLivePIDs) if (TurnOffLivePIDs)
TurnOffLiveMode(); TurnOffLiveMode();
dvbTuner->Set(Channel, DoTune); dvbTuner->Set(Channel, DoTune, !EITScanner.UsesDevice(this)); //XXX 1.3: this is an ugly hack - find a cleaner solution
// PID settings: // PID settings:

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: eitscan.c 1.13 2003/05/24 13:34:59 kls Exp $ * $Id: eitscan.c 1.14 2003/09/06 13:06:13 kls Exp $
*/ */
#include "eitscan.h" #include "eitscan.h"
@ -17,6 +17,7 @@ cEITScanner EITScanner;
cEITScanner::cEITScanner(void) cEITScanner::cEITScanner(void)
{ {
lastScan = lastActivity = time(NULL); lastScan = lastActivity = time(NULL);
currentDevice = NULL;
currentChannel = 0; currentChannel = 0;
memset(lastChannel, 0, sizeof(lastChannel)); memset(lastChannel, 0, sizeof(lastChannel));
numTransponders = 0; numTransponders = 0;
@ -66,7 +67,9 @@ void cEITScanner::Process(void)
if (Device == cDevice::PrimaryDevice() && !currentChannel) { if (Device == cDevice::PrimaryDevice() && !currentChannel) {
currentChannel = Device->CurrentChannel(); currentChannel = Device->CurrentChannel();
} }
currentDevice = Device;
Device->SwitchChannel(Channel, false); Device->SwitchChannel(Channel, false);
currentDevice = NULL;
break; break;
} }
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: eitscan.h 1.3 2003/05/24 13:21:36 kls Exp $ * $Id: eitscan.h 1.4 2003/09/06 13:05:51 kls Exp $
*/ */
#ifndef __EITSCAN_H #ifndef __EITSCAN_H
@ -19,6 +19,7 @@ private:
ScanTimeout = 20 ScanTimeout = 20
}; };
time_t lastScan, lastActivity; time_t lastScan, lastActivity;
cDevice *currentDevice;
int currentChannel; int currentChannel;
int lastChannel[MAXDEVICES]; int lastChannel[MAXDEVICES];
int numTransponders, *transponders; int numTransponders, *transponders;
@ -27,6 +28,7 @@ public:
cEITScanner(void); cEITScanner(void);
~cEITScanner(); ~cEITScanner();
bool Active(void) { return currentChannel; } bool Active(void) { return currentChannel; }
bool UsesDevice(const cDevice *Device) { return currentDevice == Device; }
void Activity(void); void Activity(void);
void Process(void); void Process(void);
}; };