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

Improved falling back to normal recording if the VPS data hasn't been seen for more than 30 seconds

This commit is contained in:
Klaus Schmidinger 2005-03-20 13:12:07 +01:00
parent 456ded045c
commit 14a38b1dba
6 changed files with 20 additions and 9 deletions

View File

@ -3469,3 +3469,5 @@ Video Disk Recorder Revision History
- Single shot timers are now reliably deleted when they have expired. - Single shot timers are now reliably deleted when they have expired.
- Fixed setting the colored button help after deleting a recording in case the next - Fixed setting the colored button help after deleting a recording in case the next
menu entry is a directory (thanks to Steffen Beyer). menu entry is a directory (thanks to Steffen Beyer).
- Improved falling back to normal recording if the VPS data hasn't been seen for more
than 30 seconds.

4
eit.c
View File

@ -8,7 +8,7 @@
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>. * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
* *
* $Id: eit.c 1.102 2005/01/02 11:52:12 kls Exp $ * $Id: eit.c 1.103 2005/03/20 12:33:51 kls Exp $
*/ */
#include "eit.h" #include "eit.h"
@ -246,6 +246,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
if (Empty && Tid == 0x4E && getSectionNumber() == 0) if (Empty && Tid == 0x4E && getSectionNumber() == 0)
// ETR 211: an empty entry in section 0 of table 0x4E means there is currently no event running // ETR 211: an empty entry in section 0 of table 0x4E means there is currently no event running
pSchedule->ClrRunningStatus(channel); pSchedule->ClrRunningStatus(channel);
if (Tid == 0x4E)
pSchedule->SetPresentSeen();
if (Modified) { if (Modified) {
pSchedule->Sort(); pSchedule->Sort();
Schedules->SetModified(pSchedule); Schedules->SetModified(pSchedule);

3
epg.c
View File

@ -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.26 2005/03/13 13:19:15 kls Exp $ * $Id: epg.c 1.27 2005/03/20 12:34:19 kls Exp $
*/ */
#include "epg.h" #include "epg.h"
@ -645,6 +645,7 @@ cSchedule::cSchedule(tChannelID ChannelID)
channelID = ChannelID; channelID = ChannelID;
hasRunning = false;; hasRunning = false;;
modified = 0; modified = 0;
presentSeen = 0;
} }
cEvent *cSchedule::AddEvent(cEvent *Event) cEvent *cSchedule::AddEvent(cEvent *Event)

6
epg.h
View File

@ -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.h 1.20 2005/03/13 13:19:30 kls Exp $ * $Id: epg.h 1.21 2005/03/20 12:32:36 kls Exp $
*/ */
#ifndef __EPG_H #ifndef __EPG_H
@ -111,11 +111,15 @@ private:
cList<cEvent> events; cList<cEvent> events;
bool hasRunning; bool hasRunning;
time_t modified; time_t modified;
time_t presentSeen;
public: public:
cSchedule(tChannelID ChannelID); cSchedule(tChannelID ChannelID);
tChannelID ChannelID(void) const { return channelID; } tChannelID ChannelID(void) const { return channelID; }
time_t Modified(void) const { return modified; } time_t Modified(void) const { return modified; }
time_t PresentSeen(void) const { return presentSeen; }
bool PresentSeenWithin(int Seconds) const { return time(NULL) - presentSeen < Seconds; }
void SetModified(void) { modified = time(NULL); } void SetModified(void) { modified = time(NULL); }
void SetPresentSeen(void) { presentSeen = time(NULL); }
void SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel = NULL); void SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel = NULL);
void ClrRunningStatus(cChannel *Channel = NULL); void ClrRunningStatus(cChannel *Channel = NULL);
void ResetVersions(void); void ResetVersions(void);

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: timers.c 1.26 2005/03/20 11:19:36 kls Exp $ * $Id: timers.c 1.27 2005/03/20 13:12:07 kls Exp $
*/ */
#include "timers.h" #include "timers.h"
@ -355,7 +355,7 @@ bool cTimer::Matches(time_t t, bool Directly) const
} }
if (HasFlags(tfActive)) { if (HasFlags(tfActive)) {
if (HasFlags(tfVps) && !Directly && event && event->Vps() && event->SeenWithin(30)) { if (HasFlags(tfVps) && !Directly && event && event->Vps() && schedule && schedule->PresentSeenWithin(30)) {
startTime = event->StartTime(); startTime = event->StartTime();
stopTime = event->EndTime(); stopTime = event->EndTime();
return event->IsRunning(true); return event->IsRunning(true);
@ -410,7 +410,7 @@ time_t cTimer::StopTime(void) const
return stopTime; return stopTime;
} }
void cTimer::SetEvent(const cEvent *Event) void cTimer::SetEvent(const cSchedule *Schedule, const cEvent *Event)
{ {
if (event != Event) { //XXX TODO check event data, too??? if (event != Event) { //XXX TODO check event data, too???
if (Event) { if (Event) {
@ -421,6 +421,7 @@ void cTimer::SetEvent(const cEvent *Event)
} }
else else
isyslog("timer %d (%d %04d-%04d '%s') set to no event", Index() + 1, Channel()->Number(), start, stop, file); isyslog("timer %d (%d %04d-%04d '%s') set to no event", Index() + 1, Channel()->Number(), start, stop, file);
schedule = Event ? Schedule : NULL;
event = Event; event = Event;
} }
} }
@ -603,7 +604,7 @@ void cTimers::SetEvents(void)
Event = e; Event = e;
} }
} }
ti->SetEvent(Event); ti->SetEvent(Schedule, Event);
} }
} }
} }

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: timers.h 1.16 2005/03/20 10:55:49 kls Exp $ * $Id: timers.h 1.17 2005/03/20 12:36:25 kls Exp $
*/ */
#ifndef __TIMERS_H #ifndef __TIMERS_H
@ -38,6 +38,7 @@ private:
int lifetime; int lifetime;
char file[MaxFileName]; char file[MaxFileName];
char *summary; char *summary;
const cSchedule *schedule;
const cEvent *event; const cEvent *event;
public: public:
cTimer(bool Instant = false, bool Pause = false); cTimer(bool Instant = false, bool Pause = false);
@ -75,7 +76,7 @@ public:
bool Expired(void); bool Expired(void);
time_t StartTime(void) const; time_t StartTime(void) const;
time_t StopTime(void) const; time_t StopTime(void) const;
void SetEvent(const cEvent *Event); void SetEvent(const cSchedule *Schedule, const cEvent *Event);
void SetRecording(bool Recording); void SetRecording(bool Recording);
void SetPending(bool Pending); void SetPending(bool Pending);
void SetInVpsMargin(bool InVpsMargin); void SetInVpsMargin(bool InVpsMargin);