summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-03-26 19:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-03-26 19:00:00 +0200
commit49b561fcad16d3315fce8cb854de9f4ee6156640 (patch)
tree5612d6646e299dec266787f6068834f28c7ca81b /epg.c
parent9d12ac30f006ed63b4c9ab4c1a076b7d4f025022 (diff)
downloadvdr-patch-lnbsharing-49b561fcad16d3315fce8cb854de9f4ee6156640.tar.gz
vdr-patch-lnbsharing-49b561fcad16d3315fce8cb854de9f4ee6156640.tar.bz2
Version 1.3.45vdr-1.3.45
- Fixed updating the "Info" button in the "Timers" menu. - Reduced the number of events to actually check when setting events to timers. - cMenuEditIntItem now checks the given value and forces it to be between the given min and max limits. - The status changes of EPG events are now logged for all channels that have timers. - Removed the log message "deleting plugin: ..." when shutting down VDR (thanks to Christoph Haubrich for reporting that this is irritating when calling "vdr --help"). - Fixed cReadLine::Read() for lines that end with the infamous "\r\n" (thanks to Rolf Ahrenberg). - Fixed cDvbDevice::SetAudioBypass() in case setTransferModeForDolbyDigital is false (thanks to Werner Fink). - Updated 'sources.conf' (thanks to Oleg Roitburd). - Fixed the shutdown timeout (thanks to Alexander Wenzel). - Only calling RemoveEmptyVideoDirectories() once in case a recording has been deleted (reported by Hardy Flor). - Fixed deleting recordings that have been removed externally when running out of disk space (reported by Jan Lenz). - Fixed handling repeating VPS timers (they stopped recording too early). - Timer log messages now show "VPS" if this is a VPS timer. - Fixed getting the present EPG event in case none is currently 'running' (it then returns the one that just ended). - Fixed calling a plugin's main menu function while a message is being displayed (reported by Helmut Auer). - Updated the Russian OSD texts (thanks to Oleg Roitburd). - Made cMenuRecordings::GetRecording() 'protected' (suggested by Marius Heidenstecker). - Speeded up cRemux::ScanVideoPacket() (thanks to Reinhard Nissl). - Enhanced logging EPG event data. - Fixed format string handling (thanks to Darren Salt). - The new function cDevice::ForceTransferMode() can be used to force the primary device into transfer mode (thanks to Reinhard Nissl). - The 'version' of EPG events is now ignored when reading EPG data from 'epg.data' or via SVDRP/PUTE to avoid problems with double EPG events. - The 'running status' of EPG events is now only set to SI::RunningStatusNotRunning for events before the present event. - Fixed some #include sequences. - Single shot VPS timers are now only considered 'expired' if their associated EPG event has been explicitly set to SI::RunningStatusNotRunning. - The check for timers to be deleted is now done only every 30 seconds.
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/epg.c b/epg.c
index 2f88af9..987efb9 100644
--- a/epg.c
+++ b/epg.c
@@ -7,14 +7,14 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.64 2006/02/26 15:07:17 kls Exp $
+ * $Id: epg.c 1.70 2006/03/26 14:06:11 kls Exp $
*/
#include "epg.h"
-#include "libsi/si.h"
-#include "timers.h"
#include <ctype.h>
#include <time.h>
+#include "libsi/si.h"
+#include "timers.h"
#define RUNNINGSTATUSTIMEOUT 30 // seconds before the running status is considered unknown
@@ -103,7 +103,7 @@ cEvent::cEvent(tEventID EventID)
eventID = EventID;
tableID = 0;
version = 0xFF; // actual version numbers are 0..31
- runningStatus = 0;
+ runningStatus = SI::RunningStatusUndefined;
title = NULL;
shortText = NULL;
description = NULL;
@@ -156,9 +156,8 @@ void cEvent::SetVersion(uchar Version)
void cEvent::SetRunningStatus(int RunningStatus, cChannel *Channel)
{
- if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined))
- if (Channel->Number() <= 30)//XXX maybe log only those that have timers???
- isyslog("channel %d (%s) event %s '%s' status %d", Channel->Number(), Channel->Name(), *GetTimeString(), Title(), RunningStatus);
+ if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined) && Channel->HasTimer())
+ isyslog("channel %d (%s) event %s status %d", Channel->Number(), Channel->Name(), *ToDescr(), RunningStatus);
runningStatus = RunningStatus;
}
@@ -209,6 +208,14 @@ void cEvent::SetSeen(void)
seen = time(NULL);
}
+cString cEvent::ToDescr(void) const
+{
+ char vpsbuf[64] = "";
+ if (Vps())
+ sprintf(vpsbuf, "(VPS: %s) ", *GetVpsString());
+ return cString::sprintf("%s %s-%s %s'%s'", *GetDateString(), *GetTimeString(), *GetEndTimeString(), vpsbuf, Title());
+}
+
bool cEvent::HasTimer(void) const
{
for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
@@ -313,7 +320,7 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
time_t StartTime;
int Duration;
unsigned int TableID = 0;
- unsigned int Version = 0xFF;
+ unsigned int Version = 0xFF; // actual value is ignored
int n = sscanf(t, "%u %ld %d %X %X", &EventID, &StartTime, &Duration, &TableID, &Version);
if (n >= 3 && n <= 5) {
Event = (cEvent *)Schedule->GetEvent(EventID, StartTime);
@@ -324,8 +331,6 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
Event = newEvent = new cEvent(EventID);
if (Event) {
Event->SetTableID(TableID);
- if (TableID >= 0x50) // makes sure the running status flag is set from the actual data stream
- Event->SetVersion(Version);
Event->SetStartTime(StartTime);
Event->SetDuration(Duration);
if (newEvent)
@@ -678,8 +683,10 @@ const cEvent *cSchedule::GetPresentEvent(void) const
const cEvent *pe = NULL;
time_t now = time(NULL);
for (cEvent *p = events.First(); p; p = events.Next(p)) {
- if (p->StartTime() <= now && now < p->EndTime())
+ if (p->StartTime() <= now)
pe = p;
+ else if (p->StartTime() > now + 3600)
+ break;
if (p->SeenWithin(RUNNINGSTATUSTIMEOUT) && p->RunningStatus() >= SI::RunningStatusPausing)
return p;
}
@@ -728,9 +735,11 @@ const cEvent *cSchedule::GetEventAround(time_t Time) const
void cSchedule::SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel)
{
for (cEvent *p = events.First(); p; p = events.Next(p)) {
- if (p == Event)
- p->SetRunningStatus(RunningStatus, Channel);
- else if (RunningStatus >= SI::RunningStatusPausing && p->RunningStatus() > SI::RunningStatusNotRunning)
+ if (p == Event) {
+ if (p->RunningStatus() > SI::RunningStatusNotRunning || RunningStatus > SI::RunningStatusNotRunning)
+ p->SetRunningStatus(RunningStatus, Channel);
+ }
+ else if (RunningStatus >= SI::RunningStatusPausing && p->StartTime() < Event->StartTime())
p->SetRunningStatus(SI::RunningStatusNotRunning);
}
if (RunningStatus >= SI::RunningStatusPausing)