summaryrefslogtreecommitdiff
path: root/dvbapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'dvbapi.c')
-rw-r--r--dvbapi.c79
1 files changed, 1 insertions, 78 deletions
diff --git a/dvbapi.c b/dvbapi.c
index e4295060..aa4f50e3 100644
--- a/dvbapi.c
+++ b/dvbapi.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.c 1.179 2002/05/19 14:46:38 kls Exp $
+ * $Id: dvbapi.c 1.180 2002/05/20 10:58:33 kls Exp $
*/
#include "dvbapi.h"
@@ -2562,80 +2562,3 @@ void cDvbApi::SetAudioCommand(const char *Command)
delete audioCommand;
audioCommand = strdup(Command);
}
-
-// --- cEITScanner -----------------------------------------------------------
-
-cEITScanner::cEITScanner(void)
-{
- lastScan = lastActivity = time(NULL);
- currentChannel = 0;
- lastChannel = 0;
- numTransponders = 0;
- transponders = NULL;
-}
-
-cEITScanner::~cEITScanner()
-{
- delete transponders;
-}
-
-bool cEITScanner::TransponderScanned(cChannel *Channel)
-{
- for (int i = 0; i < numTransponders; i++) {
- if (transponders[i] == Channel->frequency)
- return true;
- }
- transponders = (int *)realloc(transponders, ++numTransponders * sizeof(int));
- transponders[numTransponders - 1] = Channel->frequency;
- return false;
-}
-
-void cEITScanner::Activity(void)
-{
- if (currentChannel) {
- Channels.SwitchTo(currentChannel);
- currentChannel = 0;
- }
- lastActivity = time(NULL);
-}
-
-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 < MAXDVBAPI; i++) {
- cDvbApi *DvbApi = cDvbApi::GetDvbApi(i + 1, MAXPRIORITY + 1);
- if (DvbApi) {
- if (DvbApi != cDvbApi::PrimaryDvbApi || (cDvbApi::NumDvbApis == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) {
- if (!(DvbApi->Recording() || DvbApi->Replaying() || DvbApi->Transferring())) {
- int oldCh = lastChannel;
- int ch = oldCh + 1;
- while (ch != oldCh) {
- if (ch > Channels.MaxNumber()) {
- ch = 1;
- numTransponders = 0;
- }
- cChannel *Channel = Channels.GetByNumber(ch);
- if (Channel) {
- if (Channel->ca <= MAXDVBAPI && !DvbApi->ProvidesCa(Channel->ca))
- break; // the channel says it explicitly needs a different card
- if (Channel->pnr && !TransponderScanned(Channel)) {
- if (DvbApi == cDvbApi::PrimaryDvbApi && !currentChannel)
- currentChannel = DvbApi->Channel();
- Channel->Switch(DvbApi, false);
- lastChannel = ch;
- break;
- }
- }
- ch++;
- }
- }
- }
- }
- }
- lastScan = time(NULL);
- }
- }
-}
-