From f06d2c27fca449148d9d8fac19d81c668744f170 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 16 Jun 2002 18:00:00 +0200 Subject: Version 1.1.3 - Improved the VDR Makefile to avoid a warning if the '.dependencies' file does not exist, and also using $(MAKE) to call recursive makes. - Changed the name of the 'package' target in the plugin Makefiles to 'dist' (following the suggestions in the "GNU Make" manual). If you already have started a plugin project, you may want to change this in your Makefile accordingly. - Improved the plugin Makefile to avoid a warning if the '.dependencies' file does not exist, and also using $(shell...) to get the version numbers. If you already have started a plugin project, you may want to change this in your Makefile accordingly. - Fixed some function headers to make them compile with gcc 3.x (thanks to Gregoire Favre). - Fixed the cutting mechanism to make it re-sync in case a frame is larger than the buffer (thanks to Sven Grothklags). - Added an error message if the directory specified in the '-L' option can't be accessed (suggested by Stefan Huelswitt). - Rearranged OSD class names to make 'cOsd' available for the main OSD interface. - Completely moved OSD handling out of the cDvbApi class, into the new cOsd. - Implemented cStatus to allow plugins to set up a status monitor. See PLUGINS.html for details. - Moved the cEITScanner out of dvbapi.h/.c, into the new eitscan.h/.c. - Added Swedish language texts (thanks to Tomas Prybil). - Fixed parsing 'E' records in epg2html.pl (thanks to Matthias Fechner for pointing out this one). - Removed compiler option '-m486' to make it work on non-Intel platforms. If you have already started a plugin project, you may want to make sure you remove this option from your existing Makefile. - Completely rearranged the recording and replay functions to make them available to plugins. - Replay is now done in a single thread (no more syncing between input and output thread necessary). - It is now possible to record several channels on the same transponder with "budget cards". VDR automatically attaches a recording timer to a card that already records on the appropriate transponder. How many parallel recordings can actually be done depends on the computer's performance. Currently any number of recordings gets attached to a card, so you should carefully plan your timers to not exceed the limit. On a K6-II/450 it was possible to record three channels from transponder 12480 with a single WinTV NOVA-S. - Timers that record two successive shows on the same channel may now overlap and will use the same DVB card. During the time where both timers record the data is simply saved to both files. - The following limitations apply to this version: + Transfer mode doesn't work yet. + The '-a' option (for Dolby Digital audio) doesn't work yet. + Switching between different language tracks doesn't work yet. + Cutting doesn't work yet. --- eitscan.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 eitscan.c (limited to 'eitscan.c') diff --git a/eitscan.c b/eitscan.c new file mode 100644 index 0000000..f620b09 --- /dev/null +++ b/eitscan.c @@ -0,0 +1,84 @@ +/* + * eitscan.c: EIT scanner + * + * See the main source file 'vdr.c' for copyright information and + * how to reach the author. + * + * $Id: eitscan.c 1.2 2002/06/02 09:02:05 kls Exp $ + */ + +#include "eitscan.h" + +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 < MAXDEVICES; i++) { + cDevice *Device = cDevice::GetDevice(i + 1, MAXPRIORITY + 1); + if (Device) { + if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) { + if (!(Device->Receiving() || Device->Replaying()/*XXX+ || Device->Transferring()XXX*/)) { + 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 <= MAXDEVICES && !Device->ProvidesCa(Channel->ca)) + break; // the channel says it explicitly needs a different card + if (Channel->pnr && !TransponderScanned(Channel)) { + if (Device == cDevice::PrimaryDevice() && !currentChannel) + currentChannel = Device->Channel(); + Channel->Switch(Device, false); + lastChannel = ch; + break; + } + } + ch++; + } + } + } + } + } + lastScan = time(NULL); + } + } +} -- cgit v1.2.3