From 30da608c70f2a7ff23bfdf49c158630ed57d0bf2 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 8 Aug 2004 14:12:43 +0200 Subject: [PATCH] Making sure section filters are only set if the device actually has a lock --- CONTRIBUTORS | 2 ++ HISTORY | 4 +++- config.h | 6 +++--- sections.c | 24 ++++++++++++++++-------- sections.h | 4 ++-- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f09cb259..a2109316 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -271,6 +271,8 @@ Matthias Weingart Andreas Share for his support in keeping the Premiere World channels up to date in 'channels.conf' + for pointing out that section filters should only be set if the device actually has + a lock Simon Bauschulte for his support in keeping the Premiere World channels up to date in 'channels.conf' diff --git a/HISTORY b/HISTORY index 93ebfb18..ff6ba867 100644 --- a/HISTORY +++ b/HISTORY @@ -2967,6 +2967,8 @@ Video Disk Recorder Revision History - The 'radio' channel icon is now only displayed in the ST:TNG skin if the channel actually has an APID. -2004-07-27: Version 1.3.13 +2004-08-08: Version 1.3.13 - Fixed checking for the presence of NPTL (thanks to Jouni Karvo). +- Making sure section filters are only set if the device actually has a lock + (thanks to Andreas Share for pointing this out). diff --git a/config.h b/config.h index 3a67da64..6a8c6983 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.199 2004/07/17 11:09:42 kls Exp $ + * $Id: config.h 1.200 2004/08/08 13:44:17 kls Exp $ */ #ifndef __CONFIG_H @@ -20,8 +20,8 @@ #include "i18n.h" #include "tools.h" -#define VDRVERSION "1.3.12" -#define VDRVERSNUM 10312 // Version * 10000 + Major * 100 + Minor +#define VDRVERSION "1.3.13" +#define VDRVERSNUM 10313 // Version * 10000 + Major * 100 + Minor #define MAXPRIORITY 99 #define MAXLIFETIME 99 diff --git a/sections.c b/sections.c index 3b2dbe9b..8b6d3e5c 100644 --- a/sections.c +++ b/sections.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: sections.c 1.7 2004/07/17 14:26:32 kls Exp $ + * $Id: sections.c 1.8 2004/08/08 13:59:08 kls Exp $ */ #include "sections.h" @@ -46,6 +46,7 @@ cSectionHandler::cSectionHandler(cDevice *Device) active = false; statusCount = 0; on = false; + waitForLock = false; lastIncompleteSection = 0; Start(); } @@ -145,13 +146,18 @@ void cSectionHandler::SetStatus(bool On) { Lock(); if (on != On) { - statusCount++; - for (cFilter *fi = filters.First(); fi; fi = filters.Next(fi)) { - fi->SetStatus(false); - if (On) - fi->SetStatus(true); - } - on = On; + if (!On || device->HasLock()) { + statusCount++; + for (cFilter *fi = filters.First(); fi; fi = filters.Next(fi)) { + fi->SetStatus(false); + if (On) + fi->SetStatus(true); + } + on = On; + waitForLock = false; + } + else + waitForLock = On; } Unlock(); } @@ -162,6 +168,8 @@ void cSectionHandler::Action(void) while (active) { Lock(); + if (waitForLock) + SetStatus(true); int NumFilters = filterHandles.Count(); pollfd pfd[NumFilters]; for (cFilterHandle *fh = filterHandles.First(); fh; fh = filterHandles.Next(fh)) { diff --git a/sections.h b/sections.h index 670f7853..0b2b5bdf 100644 --- a/sections.h +++ b/sections.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: sections.h 1.3 2004/01/11 13:18:38 kls Exp $ + * $Id: sections.h 1.4 2004/08/08 13:44:17 kls Exp $ */ #ifndef __SECTIONS_H @@ -27,7 +27,7 @@ private: cDevice *device; bool active; int statusCount; - bool on; + bool on, waitForLock; time_t lastIncompleteSection; cList filters; cList filterHandles;