Fixed skipping unavailable channels in the EPG scanner

This commit is contained in:
Klaus Schmidinger 2003-01-26 16:20:30 +01:00
parent 2da0c04c7c
commit 829c834d30
2 changed files with 33 additions and 28 deletions

View File

@ -1940,3 +1940,4 @@ Video Disk Recorder Revision History
- Changed EIT processing to always read a full section. - Changed EIT processing to always read a full section.
- Fixed handling user defined CFLAGS in libdtv/libvdr/Makefile (thanks to Clemens - Fixed handling user defined CFLAGS in libdtv/libvdr/Makefile (thanks to Clemens
Kirchgatterer and Robert Schiele). Kirchgatterer and Robert Schiele).
- Fixed skipping unavailable channels in the EPG scanner.

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.10 2002/11/01 11:04:49 kls Exp $ * $Id: eitscan.c 1.11 2003/01/26 16:19:24 kls Exp $
*/ */
#include "eitscan.h" #include "eitscan.h"
@ -51,38 +51,42 @@ void cEITScanner::Process(void)
if (Setup.EPGScanTimeout && Channels.MaxNumber() > 1) { if (Setup.EPGScanTimeout && Channels.MaxNumber() > 1) {
time_t now = time(NULL); time_t now = time(NULL);
if (now - lastScan > ScanTimeout && now - lastActivity > ActivityTimeout) { if (now - lastScan > ScanTimeout && now - lastActivity > ActivityTimeout) {
for (int i = 0; i < cDevice::NumDevices(); i++) { do {
cDevice *Device = cDevice::GetDevice(i); int oldLastChannel = lastChannel;
if (Device && Device->CardIndex() < MAXDVBDEVICES) { for (int i = 0; i < cDevice::NumDevices(); i++) {
if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) { cDevice *Device = cDevice::GetDevice(i);
if (!(Device->Receiving(true) || Device->Replaying())) { if (Device && Device->CardIndex() < MAXDVBDEVICES) {
int oldCh = lastChannel; if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) {
int ch = oldCh + 1; if (!(Device->Receiving(true) || Device->Replaying())) {
while (ch != oldCh) { int oldCh = lastChannel;
if (ch > Channels.MaxNumber()) { int ch = oldCh + 1;
ch = 1; while (ch != oldCh) {
numTransponders = 0; if (ch > Channels.MaxNumber()) {
} ch = 1;
cChannel *Channel = Channels.GetByNumber(ch, 1); numTransponders = 0;
if (Channel) {
if (!Device->ProvidesChannel(Channel))
break;
if (Channel->Sid() && !TransponderScanned(Channel)) {
if (Device == cDevice::PrimaryDevice() && !currentChannel)
currentChannel = Device->CurrentChannel();
Device->SwitchChannel(Channel, false);
lastChannel = ch;
break;
} }
cChannel *Channel = Channels.GetByNumber(ch, 1);
if (Channel) {
if (!Device->ProvidesChannel(Channel))
break;
if (Channel->Sid() && !TransponderScanned(Channel)) {
if (Device == cDevice::PrimaryDevice() && !currentChannel)
currentChannel = Device->CurrentChannel();
Device->SwitchChannel(Channel, false);
lastChannel = ch;
break;
}
}
ch = Channel->Number() + 1;
} }
ch = Channel->Number() + 1; }
}
} }
} }
} }
else if (lastChannel != oldLastChannel)
lastChannel++; // avoid hangup in case the last channel in the list is not provided by a DVB card break;
} lastChannel++;
} while (time(NULL) - now < 2);
lastScan = time(NULL); lastScan = time(NULL);
} }
} }