summaryrefslogtreecommitdiff
path: root/eitscan.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-06-12 14:09:45 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-06-12 14:09:45 +0200
commitf41e3f327b5c7bf080be803af05358e061a37995 (patch)
tree389f78dc6d40b541a40da5190cdbf443ac962272 /eitscan.c
parenteb8ad6b46d2d65b6fd532b67818c4fdf7a00fc9b (diff)
downloadvdr-f41e3f327b5c7bf080be803af05358e061a37995.tar.gz
vdr-f41e3f327b5c7bf080be803af05358e061a37995.tar.bz2
Modified cEITScanner::Process() so that it works on systems with only budget cards or a mix of DVB-S, DVB-C or DVB-T cards
Diffstat (limited to 'eitscan.c')
-rw-r--r--eitscan.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/eitscan.c b/eitscan.c
index 9c98fff0..6b5f0224 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.25 2005/06/05 14:43:29 kls Exp $
+ * $Id: eitscan.c 1.26 2005/06/12 14:09:45 kls Exp $
*/
#include "eitscan.h"
@@ -12,6 +12,7 @@
#include "channels.h"
#include "dvbdevice.h"
#include "skins.h"
+#include "transfer.h"
// --- cScanData -------------------------------------------------------------
@@ -139,48 +140,44 @@ void cEITScanner::Process(void)
transponderList = NULL;
}
}
- for (bool AnyDeviceSwitched = false; !AnyDeviceSwitched; ) {
- cScanData *ScanData = NULL;
- for (int i = 0; i < cDevice::NumDevices(); i++) {
- if (ScanData || (ScanData = scanList->First()) != NULL) {
- cDevice *Device = cDevice::GetDevice(i);
- if (Device) {
- if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) {
- if (!(Device->Receiving(true) || Device->Replaying())) {
- const cChannel *Channel = ScanData->GetChannel();
- if (Channel) {
- if ((!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) && Device->ProvidesTransponder(Channel)) {
- if (Device == cDevice::PrimaryDevice() && !currentChannel) {
+ bool AnyDeviceSwitched = false;
+ for (int i = 0; i < cDevice::NumDevices(); i++) {
+ cDevice *Device = cDevice::GetDevice(i);
+ if (Device) {
+ for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) {
+ const cChannel *Channel = ScanData->GetChannel();
+ if (Channel) {
+ if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) {
+ if (Device->ProvidesTransponder(Channel)) {
+ if (!Device->Receiving()) {
+ if (Device != cDevice::ActualDevice() || (Device->ProvidesTransponderExclusively(Channel) && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) {
+ if (Device == cDevice::ActualDevice() && !currentChannel) {
+ if (cTransferControl::ReceiverDevice())
+ cDevice::PrimaryDevice()->StopReplay(); // stop transfer mode
currentChannel = Device->CurrentChannel();
Skins.Message(mtInfo, tr("Starting EPG scan"));
}
currentDevice = Device;//XXX see also dvbdevice.c!!!
+ //dsyslog("EIT scan: device %d source %-8s tp %5d", Device->DeviceNumber() + 1, *cSource::ToString(Channel->Source()), Channel->Transponder());
Device->SwitchChannel(Channel, false);
currentDevice = NULL;
scanList->Del(ScanData);
- ScanData = NULL;
AnyDeviceSwitched = true;
+ break;
}
}
}
}
}
}
- else
- break;
- }
- if (ScanData && !AnyDeviceSwitched) {
- scanList->Del(ScanData);
- ScanData = NULL;
- }
- if (!scanList->Count()) {
- delete scanList;
- scanList = NULL;
- if (lastActivity == 0) // this was a triggered scan
- Activity();
- break;
}
}
+ if (!scanList->Count() || !AnyDeviceSwitched) {
+ delete scanList;
+ scanList = NULL;
+ if (lastActivity == 0) // this was a triggered scan
+ Activity();
+ }
Channels.Unlock();
}
lastScan = time(NULL);