From 38c81597308acbb1287c3b5115984a0208ce24ff Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 16 May 2004 12:58:04 +0200 Subject: [PATCH] Fixed setting the time from the DVB data stream --- CONTRIBUTORS | 2 ++ HISTORY | 5 +++++ config.c | 5 ++++- config.h | 3 ++- menu.c | 4 ++-- menuitems.c | 13 ++++++++----- menuitems.h | 5 +++-- 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 700c5f71..7036bfd6 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -475,6 +475,8 @@ J Helmut Auer for reporting a superfluous error message in cLockFile for suggesting to make the "Zap timeout" a setup variable + for fixing a frequency/transponder handling mixup when setting the time from the + DVB data stream Jeremy Hall for fixing an incomplete initialization of the filter parameters in eit.c diff --git a/HISTORY b/HISTORY index 1c618bf9..f3ae89fb 100644 --- a/HISTORY +++ b/HISTORY @@ -2799,3 +2799,8 @@ Video Disk Recorder Revision History going wrong here... - Added missing NULL checks when accessing sectionHandler in device.c (thanks to Pekka Virtanen). +- Fixed setting the time from the DVB data stream (thanks to Helmut Auer for + pointing out a frequency/transponder handling mixup). This now also takes the + actual source (sat, cable etc.) into account. Please go into "Setup/EPG" and + set the "Set system time" and "Use time from transponder" parameters accordingly + (this is necessary even if you have already set them before!). diff --git a/config.c b/config.c index b89df8b6..ef362f6d 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.126 2004/05/16 10:08:09 kls Exp $ + * $Id: config.c 1.127 2004/05/16 12:43:55 kls Exp $ */ #include "config.h" @@ -258,6 +258,7 @@ cSetup::cSetup(void) LnbFrequHi = 10600; DiSEqC = 0; SetSystemTime = 0; + TimeSource = 0; TimeTransponder = 0; MarginStart = 2; MarginStop = 10; @@ -410,6 +411,7 @@ bool cSetup::Parse(const char *Name, const char *Value) else if (!strcasecmp(Name, "LnbFrequHi")) LnbFrequHi = atoi(Value); else if (!strcasecmp(Name, "DiSEqC")) DiSEqC = atoi(Value); else if (!strcasecmp(Name, "SetSystemTime")) SetSystemTime = atoi(Value); + else if (!strcasecmp(Name, "TimeSource")) TimeSource = cSource::FromString(Value); else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value); else if (!strcasecmp(Name, "MarginStart")) MarginStart = atoi(Value); else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); @@ -469,6 +471,7 @@ bool cSetup::Save(void) Store("LnbFrequHi", LnbFrequHi); Store("DiSEqC", DiSEqC); Store("SetSystemTime", SetSystemTime); + Store("TimeSource", cSource::ToString(TimeSource)); Store("TimeTransponder", TimeTransponder); Store("MarginStart", MarginStart); Store("MarginStop", MarginStop); diff --git a/config.h b/config.h index 270728d0..b9845a4e 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.192 2004/05/08 09:18:36 kls Exp $ + * $Id: config.h 1.193 2004/05/16 12:41:43 kls Exp $ */ #ifndef __CONFIG_H @@ -219,6 +219,7 @@ public: int LnbFrequHi; int DiSEqC; int SetSystemTime; + int TimeSource; int TimeTransponder; int MarginStart, MarginStop; int EPGLanguages[I18nNumLanguages + 1]; diff --git a/menu.c b/menu.c index d6d06174..968a873c 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.299 2004/05/15 14:15:33 kls Exp $ + * $Id: menu.c 1.300 2004/05/16 12:47:22 kls Exp $ */ #include "menu.h" @@ -1795,7 +1795,7 @@ void cMenuSetupEPG::Setup(void) Add(new cMenuEditIntItem( tr("Setup.EPG$EPG linger time (min)"), &data.EPGLinger, 0)); Add(new cMenuEditBoolItem(tr("Setup.EPG$Set system time"), &data.SetSystemTime)); if (data.SetSystemTime) - Add(new cMenuEditTranItem(tr("Setup.EPG$Use time from transponder"), &data.TimeTransponder)); + Add(new cMenuEditTranItem(tr("Setup.EPG$Use time from transponder"), &data.TimeTransponder, &data.TimeSource)); Add(new cMenuEditIntItem( tr("Setup.EPG$Preferred languages"), &numLanguages, 0, I18nNumLanguages)); for (int i = 0; i < numLanguages; i++) Add(new cMenuEditStraItem(tr("Setup.EPG$Preferred language"), &data.EPGLanguages[i], I18nNumLanguages, I18nLanguages())); diff --git a/menuitems.c b/menuitems.c index 743b3f31..3f835878 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c 1.17 2004/05/02 10:37:34 kls Exp $ + * $Id: menuitems.c 1.18 2004/05/16 12:47:02 kls Exp $ */ #include "menuitems.h" @@ -502,14 +502,15 @@ eOSState cMenuEditChanItem::ProcessKey(eKeys Key) // --- cMenuEditTranItem ----------------------------------------------------- -cMenuEditTranItem::cMenuEditTranItem(const char *Name, int *Value) +cMenuEditTranItem::cMenuEditTranItem(const char *Name, int *Value, int *Source) :cMenuEditChanItem(Name, Value) { number = 0; + source = Source; transponder = *Value; cChannel *channel = Channels.First(); while (channel) { - if (!channel->GroupSep() && ISTRANSPONDER(channel->Frequency(), *Value)) { + if (!channel->GroupSep() && *source == channel->Source() && ISTRANSPONDER(channel->Transponder(), *Value)) { number = channel->Number(); break; } @@ -526,8 +527,10 @@ eOSState cMenuEditTranItem::ProcessKey(eKeys Key) eOSState state = cMenuEditChanItem::ProcessKey(Key); number = *value; cChannel *channel = Channels.GetByNumber(*value); - if (channel) - transponder = channel->Frequency(); + if (channel) { + *source = channel->Source(); + transponder = channel->Transponder(); + } *value = transponder; return state; } diff --git a/menuitems.h b/menuitems.h index 6e9061b8..5a2912c8 100644 --- a/menuitems.h +++ b/menuitems.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.h 1.8 2004/04/30 13:45:28 kls Exp $ + * $Id: menuitems.h 1.9 2004/05/16 12:45:14 kls Exp $ */ #ifndef __MENUITEMS_H @@ -111,9 +111,10 @@ public: class cMenuEditTranItem : public cMenuEditChanItem { private: int number; + int *source; int transponder; public: - cMenuEditTranItem(const char *Name, int *Value); + cMenuEditTranItem(const char *Name, int *Value, int *Source); virtual eOSState ProcessKey(eKeys Key); };