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

This commit is contained in:
Klaus Schmidinger 2005-06-12 14:09:45 +02:00
parent eb8ad6b46d
commit f41e3f327b
4 changed files with 40 additions and 29 deletions

View File

@ -3604,3 +3604,5 @@ Video Disk Recorder Revision History
- Fixed handling page up/down in menu lists in case there are several non selectable
items in a row (thanks to Udo Richter for reporting this one).
- Added cOsdMenu::SetCols() to allow adjusting the menu columns.
- 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.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 1.102 2005/06/05 13:28:03 kls Exp $
* $Id: device.c 1.103 2005/06/12 13:39:11 kls Exp $
*/
#include "device.h"
@ -505,6 +505,15 @@ bool cDevice::ProvidesTransponder(const cChannel *Channel) const
return false;
}
bool cDevice::ProvidesTransponderExclusively(const cChannel *Channel) const
{
for (int i = 0; i < numDevices; i++) {
if (device[i] && device[i] != this && device[i]->ProvidesTransponder(Channel))
return false;
}
return true;
}
bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
{
return false;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.h 1.58 2005/06/05 12:56:08 kls Exp $
* $Id: device.h 1.59 2005/06/12 13:35:47 kls Exp $
*/
#ifndef __DEVICE_H
@ -186,6 +186,9 @@ public:
///< Returns true if this device can provide the given source.
virtual bool ProvidesTransponder(const cChannel *Channel) const;
///< XXX -> PLUGINS.html!
virtual bool ProvidesTransponderExclusively(const cChannel *Channel) const;
///< Returns true if this is the only device that is able to provide
///< the given channel's transponder.
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
///< Returns true if this device can provide the given channel.
///< In case the device has cReceivers attached to it or it is the primary

View File

@ -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);