summaryrefslogtreecommitdiff
path: root/eitscan.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-01-05 09:56:54 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-01-05 09:56:54 +0100
commit113957107e0cbd98498339804d7dcdba4449761e (patch)
treef74d93754e7ca6f989fa38637b33245838cc3241 /eitscan.c
parenta80709f1ddfe77667cf4d149343d3497593b1ca3 (diff)
downloadvdr-113957107e0cbd98498339804d7dcdba4449761e.tar.gz
vdr-113957107e0cbd98498339804d7dcdba4449761e.tar.bz2
Fixed a lockup in the EPG scanner when no non-primary device was available
Diffstat (limited to 'eitscan.c')
-rw-r--r--eitscan.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/eitscan.c b/eitscan.c
index d4d1e8f3..755bddf1 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.15 2004/01/04 12:28:00 kls Exp $
+ * $Id: eitscan.c 1.16 2004/01/05 09:51:25 kls Exp $
*/
#include "eitscan.h"
@@ -110,13 +110,11 @@ void cEITScanner::Process(void)
for (bool AnyDeviceSwitched = false; !AnyDeviceSwitched; ) {
cScanData *ScanData = NULL;
for (int i = 0; i < cDevice::NumDevices(); i++) {
- 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())) {
- if (!ScanData)
- ScanData = scanList->First();
- if (ScanData) {
+ 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())) {
cChannel *Channel = ScanData->GetChannel();
//XXX if (Device->ProvidesTransponder(Channel)) {
if ((!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) && Device->ProvidesTransponder(Channel)) { //XXX temporary for the 'sky' plugin
@@ -130,11 +128,11 @@ void cEITScanner::Process(void)
AnyDeviceSwitched = true;
}
}
- else
- break;
}
}
}
+ else
+ break;
}
if (ScanData && !AnyDeviceSwitched) {
scanList->Del(ScanData);
@@ -146,9 +144,9 @@ void cEITScanner::Process(void)
break;
}
}
- Channels.Unlock();
- lastScan = time(NULL);
}
+ lastScan = time(NULL);
+ Channels.Unlock();
}
}
}