summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-09-06 13:22:24 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-09-06 13:22:24 +0200
commitee10028dc6ce314e1848a206bbdde18bde40b4ec (patch)
treec0e8920a6779ab82cc52050e602b21895deeaf52
parent6d677e2a89afe9ceb91483f4da581cdad6f8cc5d (diff)
downloadvdr-ee10028dc6ce314e1848a206bbdde18bde40b4ec.tar.gz
vdr-ee10028dc6ce314e1848a206bbdde18bde40b4ec.tar.bz2
The DVB devices no longer send CA descriptors to the CAM while the EPG scanner is active
-rw-r--r--HISTORY3
-rw-r--r--dvbdevice.c14
-rw-r--r--eitscan.c5
-rw-r--r--eitscan.h4
4 files changed, 19 insertions, 7 deletions
diff --git a/HISTORY b/HISTORY
index 17513b02..d8ad124a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2372,3 +2372,6 @@ Video Disk Recorder Revision History
- 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
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).
diff --git a/dvbdevice.c b/dvbdevice.c
index 19be0223..f29745b2 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -74,6 +74,7 @@ private:
cChannel channel;
const char *diseqcCommands;
bool active;
+ bool useCa;
time_t startTime;
eTunerStatus tunerStatus;
cMutex mutex;
@@ -84,7 +85,7 @@ public:
cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCiHandler *CiHandler);
virtual ~cDvbTuner();
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; }
};
@@ -96,6 +97,7 @@ cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCi
ciHandler = CiHandler;
diseqcCommands = NULL;
active = false;
+ useCa = false;
tunerStatus = tsIdle;
startTime = time(NULL);
Start();
@@ -114,7 +116,7 @@ bool cDvbTuner::IsTunedTo(const cChannel *Channel) const
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);
bool CaChange = !(Channel->GetChannelID() == channel.GetChannelID());
@@ -122,6 +124,7 @@ void cDvbTuner::Set(const cChannel *Channel, bool Tune)
tunerStatus = tsSet;
else if (tunerStatus == tsCam && CaChange)
tunerStatus = tsTuned;
+ useCa = UseCa;
if (Channel->Ca() && CaChange)
startTime = time(NULL);
channel = *Channel;
@@ -267,7 +270,7 @@ void cDvbTuner::Action(void)
}
if (tunerStatus >= tsLocked) {
if (ciHandler) {
- if (ciHandler->Process()) {
+ if (ciHandler->Process() && useCa) {
if (tunerStatus != tsCam) {//XXX TODO update in case the CA descriptors have changed
for (int Slot = 0; Slot < ciHandler->NumSlots(); Slot++) {
uchar buffer[2048];
@@ -673,6 +676,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
StartTransferMode = false;
#endif
+ // XXX 1.3: use the same mechanism as below (!EITScanner.UsesDevice(this))
if (EITScanner.Active()) {
StartTransferMode = false;
TurnOnLivePIDs = false;
@@ -690,7 +694,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (TurnOffLivePIDs)
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:
diff --git a/eitscan.c b/eitscan.c
index f9058cf0..a12bb44d 100644
--- a/eitscan.c
+++ b/eitscan.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -17,6 +17,7 @@ cEITScanner EITScanner;
cEITScanner::cEITScanner(void)
{
lastScan = lastActivity = time(NULL);
+ currentDevice = NULL;
currentChannel = 0;
memset(lastChannel, 0, sizeof(lastChannel));
numTransponders = 0;
@@ -66,7 +67,9 @@ void cEITScanner::Process(void)
if (Device == cDevice::PrimaryDevice() && !currentChannel) {
currentChannel = Device->CurrentChannel();
}
+ currentDevice = Device;
Device->SwitchChannel(Channel, false);
+ currentDevice = NULL;
break;
}
}
diff --git a/eitscan.h b/eitscan.h
index 609bf78f..420f47d0 100644
--- a/eitscan.h
+++ b/eitscan.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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
@@ -19,6 +19,7 @@ private:
ScanTimeout = 20
};
time_t lastScan, lastActivity;
+ cDevice *currentDevice;
int currentChannel;
int lastChannel[MAXDEVICES];
int numTransponders, *transponders;
@@ -27,6 +28,7 @@ public:
cEITScanner(void);
~cEITScanner();
bool Active(void) { return currentChannel; }
+ bool UsesDevice(const cDevice *Device) { return currentDevice == Device; }
void Activity(void);
void Process(void);
};