1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

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 - 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). items in a row (thanks to Udo Richter for reporting this one).
- Added cOsdMenu::SetCols() to allow adjusting the menu columns. - 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 * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "device.h"
@ -505,6 +505,15 @@ bool cDevice::ProvidesTransponder(const cChannel *Channel) const
return false; 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 bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
{ {
return false; return false;

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: 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 #ifndef __DEVICE_H
@ -186,6 +186,9 @@ public:
///< Returns true if this device can provide the given source. ///< Returns true if this device can provide the given source.
virtual bool ProvidesTransponder(const cChannel *Channel) const; virtual bool ProvidesTransponder(const cChannel *Channel) const;
///< XXX -> PLUGINS.html! ///< 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; virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
///< Returns true if this device can provide the given channel. ///< Returns true if this device can provide the given channel.
///< In case the device has cReceivers attached to it or it is the primary ///< 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 * 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.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" #include "eitscan.h"
@ -12,6 +12,7 @@
#include "channels.h" #include "channels.h"
#include "dvbdevice.h" #include "dvbdevice.h"
#include "skins.h" #include "skins.h"
#include "transfer.h"
// --- cScanData ------------------------------------------------------------- // --- cScanData -------------------------------------------------------------
@ -139,48 +140,44 @@ void cEITScanner::Process(void)
transponderList = NULL; transponderList = NULL;
} }
} }
for (bool AnyDeviceSwitched = false; !AnyDeviceSwitched; ) { bool AnyDeviceSwitched = false;
cScanData *ScanData = NULL; for (int i = 0; i < cDevice::NumDevices(); i++) {
for (int i = 0; i < cDevice::NumDevices(); i++) { cDevice *Device = cDevice::GetDevice(i);
if (ScanData || (ScanData = scanList->First()) != NULL) { if (Device) {
cDevice *Device = cDevice::GetDevice(i); for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) {
if (Device) { const cChannel *Channel = ScanData->GetChannel();
if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) { if (Channel) {
if (!(Device->Receiving(true) || Device->Replaying())) { if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) {
const cChannel *Channel = ScanData->GetChannel(); if (Device->ProvidesTransponder(Channel)) {
if (Channel) { if (!Device->Receiving()) {
if ((!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) && Device->ProvidesTransponder(Channel)) { if (Device != cDevice::ActualDevice() || (Device->ProvidesTransponderExclusively(Channel) && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) {
if (Device == cDevice::PrimaryDevice() && !currentChannel) { if (Device == cDevice::ActualDevice() && !currentChannel) {
if (cTransferControl::ReceiverDevice())
cDevice::PrimaryDevice()->StopReplay(); // stop transfer mode
currentChannel = Device->CurrentChannel(); currentChannel = Device->CurrentChannel();
Skins.Message(mtInfo, tr("Starting EPG scan")); Skins.Message(mtInfo, tr("Starting EPG scan"));
} }
currentDevice = Device;//XXX see also dvbdevice.c!!! 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); Device->SwitchChannel(Channel, false);
currentDevice = NULL; currentDevice = NULL;
scanList->Del(ScanData); scanList->Del(ScanData);
ScanData = NULL;
AnyDeviceSwitched = true; 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(); Channels.Unlock();
} }
lastScan = time(NULL); lastScan = time(NULL);