mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
The EPG scanner now scans each transponder only once per cycle
This commit is contained in:
parent
20d94646d1
commit
2adfad2823
1
HISTORY
1
HISTORY
@ -375,3 +375,4 @@ Video Disk Recorder Revision History
|
|||||||
Dave Chapman). Existing files will be read normally (and the teletext PID set
|
Dave Chapman). Existing files will be read normally (and the teletext PID set
|
||||||
to 0), but once they are written back (due to some channel editing) the file
|
to 0), but once they are written back (due to some channel editing) the file
|
||||||
will have the new format.
|
will have the new format.
|
||||||
|
- The EPG scanner now scans each transponder only once per cycle.
|
||||||
|
26
dvbapi.c
26
dvbapi.c
@ -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: dvbapi.c 1.56 2001/02/03 16:00:23 kls Exp $
|
* $Id: dvbapi.c 1.57 2001/02/03 17:43:21 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbapi.h"
|
#include "dvbapi.h"
|
||||||
@ -2408,6 +2408,24 @@ cEITScanner::cEITScanner(void)
|
|||||||
lastScan = lastActivity = time(NULL);
|
lastScan = lastActivity = time(NULL);
|
||||||
currentChannel = 0;
|
currentChannel = 0;
|
||||||
lastChannel = 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)
|
void cEITScanner::Activity(void)
|
||||||
@ -2432,10 +2450,12 @@ void cEITScanner::Process(void)
|
|||||||
int oldCh = lastChannel;
|
int oldCh = lastChannel;
|
||||||
int ch = oldCh + 1;
|
int ch = oldCh + 1;
|
||||||
while (ch != oldCh) {
|
while (ch != oldCh) {
|
||||||
if (ch > Channels.MaxNumber())
|
if (ch > Channels.MaxNumber()) {
|
||||||
ch = 1;
|
ch = 1;
|
||||||
|
numTransponders = 0;
|
||||||
|
}
|
||||||
cChannel *Channel = Channels.GetByNumber(ch);
|
cChannel *Channel = Channels.GetByNumber(ch);
|
||||||
if (Channel && Channel->pnr) {
|
if (Channel && Channel->pnr && !TransponderScanned(Channel)) {
|
||||||
if (DvbApi == cDvbApi::PrimaryDvbApi && !currentChannel)
|
if (DvbApi == cDvbApi::PrimaryDvbApi && !currentChannel)
|
||||||
currentChannel = DvbApi->Channel();
|
currentChannel = DvbApi->Channel();
|
||||||
Channel->Switch(DvbApi, false);
|
Channel->Switch(DvbApi, false);
|
||||||
|
7
dvbapi.h
7
dvbapi.h
@ -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: dvbapi.h 1.32 2001/02/03 15:59:35 kls Exp $
|
* $Id: dvbapi.h 1.33 2001/02/03 17:39:33 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __DVBAPI_H
|
#ifndef __DVBAPI_H
|
||||||
@ -48,6 +48,8 @@ const char *IndexToHMSF(int Index, bool WithFrame = false);
|
|||||||
int HMSFToIndex(const char *HMSF);
|
int HMSFToIndex(const char *HMSF);
|
||||||
// Converts the given string (format: "hh:mm:ss.ff") to an index.
|
// Converts the given string (format: "hh:mm:ss.ff") to an index.
|
||||||
|
|
||||||
|
class cChannel;
|
||||||
|
|
||||||
class cRecordBuffer;
|
class cRecordBuffer;
|
||||||
class cReplayBuffer;
|
class cReplayBuffer;
|
||||||
class cTransferBuffer;
|
class cTransferBuffer;
|
||||||
@ -256,8 +258,11 @@ private:
|
|||||||
};
|
};
|
||||||
time_t lastScan, lastActivity;
|
time_t lastScan, lastActivity;
|
||||||
int currentChannel, lastChannel;
|
int currentChannel, lastChannel;
|
||||||
|
int numTransponders, *transponders;
|
||||||
|
bool TransponderScanned(cChannel *Channel);
|
||||||
public:
|
public:
|
||||||
cEITScanner(void);
|
cEITScanner(void);
|
||||||
|
~cEITScanner();
|
||||||
bool Active(void) { return currentChannel; }
|
bool Active(void) { return currentChannel; }
|
||||||
void Activity(void);
|
void Activity(void);
|
||||||
void Process(void);
|
void Process(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user