mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
If VPS timers are active, their events are now being kept up to date
This commit is contained in:
parent
93d0120c3f
commit
465ddf3ffc
4
HISTORY
4
HISTORY
@ -4688,7 +4688,7 @@ Video Disk Recorder Revision History
|
|||||||
- Updated the Italian OSD texts (thanks to Nino Gerbino and Antonio Ospite).
|
- Updated the Italian OSD texts (thanks to Nino Gerbino and Antonio Ospite).
|
||||||
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
|
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
|
||||||
|
|
||||||
2006-05-06: Version 1.4.0-1
|
2006-05-07: Version 1.4.0-1
|
||||||
|
|
||||||
- Updated 'S110W' in 'sources.conf'.
|
- Updated 'S110W' in 'sources.conf'.
|
||||||
- Adjusted the 'runvdr' script so that the user can fill in the functions to
|
- Adjusted the 'runvdr' script so that the user can fill in the functions to
|
||||||
@ -4705,3 +4705,5 @@ Video Disk Recorder Revision History
|
|||||||
- When checking whether a VPS timer has entered the "VPS margin", the event's start
|
- When checking whether a VPS timer has entered the "VPS margin", the event's start
|
||||||
time is now used instead of the timer's start time, because otherwise events that
|
time is now used instead of the timer's start time, because otherwise events that
|
||||||
start way off of their VPS time wouldn't be recorded correctly.
|
start way off of their VPS time wouldn't be recorded correctly.
|
||||||
|
- If VPS timers are active, their events are now being kept up to date if there
|
||||||
|
are any free devices available.
|
||||||
|
6
epg.c
6
epg.c
@ -7,7 +7,7 @@
|
|||||||
* Original version (as used in VDR before 1.3.0) written by
|
* Original version (as used in VDR before 1.3.0) written by
|
||||||
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
||||||
*
|
*
|
||||||
* $Id: epg.c 1.72 2006/04/22 12:02:47 kls Exp $
|
* $Id: epg.c 1.73 2006/05/07 09:13:36 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "epg.h"
|
#include "epg.h"
|
||||||
@ -327,8 +327,10 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
|
|||||||
cEvent *newEvent = NULL;
|
cEvent *newEvent = NULL;
|
||||||
if (Event)
|
if (Event)
|
||||||
DELETENULL(Event->components);
|
DELETENULL(Event->components);
|
||||||
if (!Event)
|
if (!Event) {
|
||||||
Event = newEvent = new cEvent(EventID);
|
Event = newEvent = new cEvent(EventID);
|
||||||
|
Event->seen = 0;
|
||||||
|
}
|
||||||
if (Event) {
|
if (Event) {
|
||||||
Event->SetTableID(TableID);
|
Event->SetTableID(TableID);
|
||||||
Event->SetStartTime(StartTime);
|
Event->SetStartTime(StartTime);
|
||||||
|
29
vdr.c
29
vdr.c
@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
* The project's page is at http://www.cadsoft.de/vdr
|
* The project's page is at http://www.cadsoft.de/vdr
|
||||||
*
|
*
|
||||||
* $Id: vdr.c 1.268 2006/05/05 13:43:32 kls Exp $
|
* $Id: vdr.c 1.269 2006/05/07 09:13:36 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -74,6 +74,8 @@
|
|||||||
#define SHUTDOWNRETRY 300 // seconds before trying again to shut down
|
#define SHUTDOWNRETRY 300 // seconds before trying again to shut down
|
||||||
#define VPSCHECKDELTA 10 // seconds between checks for timers that have entered the VPS margin
|
#define VPSCHECKDELTA 10 // seconds between checks for timers that have entered the VPS margin
|
||||||
#define VPSDEVICETIMEOUT 8 // seconds before a device used for VPS may be reused
|
#define VPSDEVICETIMEOUT 8 // seconds before a device used for VPS may be reused
|
||||||
|
#define VPSLOOKAHEADTIME 24 // hours within which VPS timers will make sure their events are up to date
|
||||||
|
#define VPSUPTODATETIME 3600 // seconds before the event or schedule of a VPS timer needs to be refreshed
|
||||||
|
|
||||||
#define EXIT(v) { ExitCode = (v); goto Exit; }
|
#define EXIT(v) { ExitCode = (v); goto Exit; }
|
||||||
|
|
||||||
@ -762,8 +764,24 @@ int main(int argc, char *argv[])
|
|||||||
TimerInVpsMargin = false;
|
TimerInVpsMargin = false;
|
||||||
static time_t DeviceUsed[MAXDEVICES] = { 0 };
|
static time_t DeviceUsed[MAXDEVICES] = { 0 };
|
||||||
for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) {
|
for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) {
|
||||||
if (Timer->HasFlags(tfActive | tfVps) && !Timer->Recording() && Timer->Matches(Now, true, Setup.VpsMargin)) {
|
bool InVpsMargin = false;
|
||||||
Timer->SetInVpsMargin(true);
|
bool NeedsTransponder = false;
|
||||||
|
if (Timer->HasFlags(tfActive | tfVps) && !Timer->Recording()) {
|
||||||
|
if (Timer->Matches(Now, true, Setup.VpsMargin))
|
||||||
|
TimerInVpsMargin = InVpsMargin = true;
|
||||||
|
else if (Timer->Event())
|
||||||
|
NeedsTransponder = Timer->Event()->StartTime() - Now < VPSLOOKAHEADTIME * 3600 && !Timer->Event()->SeenWithin(VPSUPTODATETIME);
|
||||||
|
else {
|
||||||
|
cSchedulesLock SchedulesLock;
|
||||||
|
const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
|
||||||
|
if (Schedules) {
|
||||||
|
const cSchedule *Schedule = Schedules->GetSchedule(Timer->Channel());
|
||||||
|
NeedsTransponder = Schedule && !Schedule->PresentSeenWithin(VPSUPTODATETIME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Timer->SetInVpsMargin(InVpsMargin);
|
||||||
|
if (NeedsTransponder || InVpsMargin) {
|
||||||
// Find a device that provides the required transponder:
|
// Find a device that provides the required transponder:
|
||||||
cDevice *Device = NULL;
|
cDevice *Device = NULL;
|
||||||
for (int i = 0; i < cDevice::NumDevices(); i++) {
|
for (int i = 0; i < cDevice::NumDevices(); i++) {
|
||||||
@ -785,7 +803,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!Device) {
|
if (!Device && InVpsMargin) {
|
||||||
cDevice *d = cDevice::ActualDevice();
|
cDevice *d = cDevice::ActualDevice();
|
||||||
if (!d->Receiving() && d->ProvidesTransponder(Timer->Channel()) && Now - DeviceUsed[d->DeviceNumber()] > VPSDEVICETIMEOUT)
|
if (!d->Receiving() && d->ProvidesTransponder(Timer->Channel()) && Now - DeviceUsed[d->DeviceNumber()] > VPSDEVICETIMEOUT)
|
||||||
Device = d; // use the actual device as a last resort
|
Device = d; // use the actual device as a last resort
|
||||||
@ -805,10 +823,7 @@ int main(int argc, char *argv[])
|
|||||||
Skins.Message(mtInfo, tr("Upcoming VPS recording!"));
|
Skins.Message(mtInfo, tr("Upcoming VPS recording!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TimerInVpsMargin = true;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
Timer->SetInVpsMargin(false);
|
|
||||||
}
|
}
|
||||||
LastVpsCheck = time(NULL);
|
LastVpsCheck = time(NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user