summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2009-04-12 22:29:35 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2009-04-12 11:39:00 +0200
commit1aadb31fb355550bb415ed971322a9bcb80f9325 (patch)
tree6a6fb763f2c56073e91e3052d20aa20695fa2667 /eit.c
parent084e16c057ab195a76c2117c631a2fe10a904238 (diff)
downloadvdr-patch-lnbsharing-1aadb31fb355550bb415ed971322a9bcb80f9325.tar.gz
vdr-patch-lnbsharing-1aadb31fb355550bb415ed971322a9bcb80f9325.tar.bz2
Version 1.7.5vdr-1.7.5
- Fixed a hangup when replaying a TS recording with subtitles activated (reported by Timo Helkio). - Fixed handling the 'new' indicator in the recordings menu for TS recordings (thanks to Derek Kelly). - Added cap_sys_nice to the capabilities that are not dropped (thanks to Rolf Ahrenberg). - Updated the Italian OSD texts (thanks to Diego Pierotto). - Added cRecordingInfo::GetEvent() (thanks to Marcel Unbehaun). - Improved synchronizing the progress display, trick modes and subtitle display to the actual audio/video. This now works independent of any buffer sizes the output device might use. + The cBackTrace class has been replaced with cPtsIndex, which keeps track of the PTS timestamps of recently played frames. + cDevice::GetSTC() is now required to deliver the STC even in trick modes. It is sufficient if it returns the PTS of the most recently presented audio/video frame. + The full-featured DVB cards need an improved firmware in order to return proper STC values in trick modes (thanks to Oliver Endriss for enhancing the av7110 firmware). - Adapted cFrameDetector::Analyze() to HD NTSC broadcasts that split frames over several payload units (thanks to Derek Kelly for reporting this and helping in testing). - Modified cFrameDetector::Analyze() to make it process whole frames at once, so that file I/O overhead is minimized during recording (reported by Günter Niedermeier). - Added command line help for the '-i' option. - Fixed cDvbPlayer::NextFile() to handle files larger than 2GB (thanks to Jose Alberto Reguero). - Improved replay at the begin and end of a recording. The very first and very last frame is now sent to the output device repeatedly until GetSTC() reports that it has been played. cDvbPlayer::Action() no longer calls DeviceFlush() (thanks to Reinhard Nissl for making sure vdr-xine no longer needs this). - Added missing '[]' to the delete operator in cMenuEditStrItem::~cMenuEditStrItem(). - Added missing virtual destructor to cPalette. - Now freeing configDirectory before setting it to a new value in cPlugin::SetConfigDirectory(). - Fixed a crash when jumping to an editing mark in an audio recording. - Fixed the 'VideoOnly' condition in the PlayPes() and PlayTs() calls in cDvbPlayer::Action() (thanks to Reinhard Nissl). - cDevice::PlayTs() now plays as many TS packets as possible in one call. - Making sure any floating point numbers written use a decimal point (thanks to Oliver Endriss for pointing out a problem with the F record in the info file of a recording). - Fixed detecting the frame rate for radio recordings. - Added missing AUDIO_PAUSE/AUDIO_CONTINUE calls to cDvbDevice (thanks to Oliver Endriss). - No longer writing the video type into channels.conf if VPID is 0 (thanks to Oliver Endriss for reporting this). - Improved efficiency of cEIT::cEIT() (thanks to Tobias Bratfisch).
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/eit.c b/eit.c
index 774b667..b78c117 100644
--- a/eit.c
+++ b/eit.c
@@ -8,7 +8,7 @@
* 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>.
*
- * $Id: eit.c 2.2 2008/05/01 15:33:27 kls Exp $
+ * $Id: eit.c 2.3 2009/04/11 10:03:24 kls Exp $
*/
#include "eit.h"
@@ -42,20 +42,25 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
bool HasExternalData = false;
time_t SegmentStart = 0;
time_t SegmentEnd = 0;
+ time_t Now = time(NULL);
+ struct tm tm_r;
+ struct tm t = *localtime_r(&Now, &tm_r); // this initializes the time zone in 't'
SI::EIT::Event SiEitEvent;
for (SI::Loop::Iterator it; eventLoop.getNext(SiEitEvent, it); ) {
bool ExternalData = false;
+ int StartTime = SiEitEvent.getStartTime();
+ int Duration = SiEitEvent.getDuration();
// Drop bogus events - but keep NVOD reference events, where all bits of the start time field are set to 1, resulting in a negative number.
- if (SiEitEvent.getStartTime() == 0 || SiEitEvent.getStartTime() > 0 && SiEitEvent.getDuration() == 0)
+ if (StartTime == 0 || StartTime > 0 && Duration == 0)
continue;
Empty = false;
if (!SegmentStart)
- SegmentStart = SiEitEvent.getStartTime();
- SegmentEnd = SiEitEvent.getStartTime() + SiEitEvent.getDuration();
+ SegmentStart = StartTime;
+ SegmentEnd = StartTime + Duration;
cEvent *newEvent = NULL;
cEvent *rEvent = NULL;
- cEvent *pEvent = (cEvent *)pSchedule->GetEvent(SiEitEvent.getEventId(), SiEitEvent.getStartTime());
+ cEvent *pEvent = (cEvent *)pSchedule->GetEvent(SiEitEvent.getEventId(), StartTime);
if (!pEvent) {
if (OnlyRunningStatus)
continue;
@@ -70,14 +75,15 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
pEvent->SetSeen();
// If the existing event has a zero table ID it was defined externally and shall
// not be overwritten.
- if (pEvent->TableID() == 0x00) {
+ uchar TableID = pEvent->TableID();
+ if (TableID == 0x00) {
if (pEvent->Version() == getVersionNumber())
continue;
HasExternalData = ExternalData = true;
}
// If the new event has a higher table ID, let's skip it.
// The lower the table ID, the more "current" the information.
- else if (Tid > pEvent->TableID())
+ else if (Tid > TableID)
continue;
// If the new event comes from the same table and has the same version number
// as the existing one, let's skip it to avoid unnecessary work.
@@ -85,14 +91,14 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
// the actual Premiere transponder and the Sat.1/Pro7 transponder), but use different version numbers on
// each of them :-( So if one DVB card is tuned to the Premiere transponder, while an other one is tuned
// to the Sat.1/Pro7 transponder, events will keep toggling because of the bogus version numbers.
- else if (Tid == pEvent->TableID() && pEvent->Version() == getVersionNumber())
+ else if (Tid == TableID && pEvent->Version() == getVersionNumber())
continue;
}
if (!ExternalData) {
pEvent->SetEventID(SiEitEvent.getEventId()); // unfortunately some stations use different event ids for the same event in different tables :-(
pEvent->SetTableID(Tid);
- pEvent->SetStartTime(SiEitEvent.getStartTime());
- pEvent->SetDuration(SiEitEvent.getDuration());
+ pEvent->SetStartTime(StartTime);
+ pEvent->SetDuration(Duration);
}
if (newEvent)
pSchedule->AddEvent(newEvent);
@@ -148,9 +154,6 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
break;
case SI::PDCDescriptorTag: {
SI::PDCDescriptor *pd = (SI::PDCDescriptor *)d;
- time_t now = time(NULL);
- struct tm tm_r;
- struct tm t = *localtime_r(&now, &tm_r); // this initializes the time zone in 't'
t.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
int month = t.tm_mon;
t.tm_mon = pd->getMonth() - 1;
@@ -183,8 +186,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
SI::LinkageDescriptor *ld = (SI::LinkageDescriptor *)d;
tChannelID linkID(Source, ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId());
if (ld->getLinkageType() == 0xB0) { // Premiere World
- time_t now = time(NULL);
- bool hit = SiEitEvent.getStartTime() <= now && now < SiEitEvent.getStartTime() + SiEitEvent.getDuration();
+ bool hit = StartTime <= Now && Now < StartTime + Duration;
if (hit) {
char linkName[ld->privateData.getLength() + 1];
strn0cpy(linkName, (const char *)ld->privateData.getData(), sizeof(linkName));
@@ -260,11 +262,12 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
channel->SetLinkChannels(LinkChannels);
Modified = true;
}
- if (Empty && Tid == 0x4E && getSectionNumber() == 0)
- // ETR 211: an empty entry in section 0 of table 0x4E means there is currently no event running
- pSchedule->ClrRunningStatus(channel);
- if (Tid == 0x4E)
+ if (Tid == 0x4E) {
+ if (Empty && getSectionNumber() == 0)
+ // ETR 211: an empty entry in section 0 of table 0x4E means there is currently no event running
+ pSchedule->ClrRunningStatus(channel);
pSchedule->SetPresentSeen();
+ }
if (OnlyRunningStatus)
return;
if (Modified) {