diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-09-04 17:26:02 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-09-04 17:26:02 +0200 |
commit | 3e58bc64fece489778cdd2dc3df24c9bdca28779 (patch) | |
tree | d9e311dcb8d11f3436a9cd4f4a0e9b6b377e3a76 /eitscan.c | |
parent | 1967d0cd3d4b4b6295f31d8cef2895e2de1a71d9 (diff) | |
download | vdr-3e58bc64fece489778cdd2dc3df24c9bdca28779.tar.gz vdr-3e58bc64fece489778cdd2dc3df24c9bdca28779.tar.bz2 |
Implemented recording and replaying with a single DVB card
Diffstat (limited to 'eitscan.c')
-rw-r--r-- | eitscan.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -4,11 +4,12 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: eitscan.c 1.5 2002/08/11 11:11:39 kls Exp $ + * $Id: eitscan.c 1.6 2002/09/04 13:32:38 kls Exp $ */ #include "eitscan.h" #include <stdlib.h> +#include "dvbdevice.h" cEITScanner::cEITScanner(void) { @@ -49,9 +50,9 @@ void cEITScanner::Process(void) if (Setup.EPGScanTimeout && Channels.MaxNumber() > 1) { time_t now = time(NULL); if (now - lastScan > ScanTimeout && now - lastActivity > ActivityTimeout) { - for (int i = 0; i < MAXDEVICES; i++) { - cDevice *Device = cDevice::GetDevice(i + 1, MAXPRIORITY + 1); - if (Device) { + for (int i = 0; i < cDevice::NumDevices(); i++) { + cDevice *Device = cDevice::GetDevice(i); + if (Device && Device->CardIndex() < MAXDVBDEVICES) { if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) { if (!(Device->Receiving() || Device->Replaying())) { int oldCh = lastChannel; @@ -63,12 +64,12 @@ void cEITScanner::Process(void) } cChannel *Channel = Channels.GetByNumber(ch); if (Channel) { - if (Channel->ca <= MAXDEVICES && !Device->ProvidesCa(Channel->ca)) - break; // the channel says it explicitly needs a different card + if (!Device->ProvidesChannel(Channel)) + break; if (Channel->pnr && !TransponderScanned(Channel)) { if (Device == cDevice::PrimaryDevice() && !currentChannel) currentChannel = Device->Channel(); - Channel->Switch(Device, false); + Device->SwitchChannel(Channel, false); lastChannel = ch; break; } @@ -78,6 +79,8 @@ void cEITScanner::Process(void) } } } + else + lastChannel++; // avoid hangup in case the last channel in the list is not provided by a DVB card } lastScan = time(NULL); } |