Making sure section filters are only set if the device actually has a lock

This commit is contained in:
Klaus Schmidinger 2004-08-08 14:12:43 +02:00
parent 4a72fd75c2
commit 30da608c70
5 changed files with 26 additions and 14 deletions

View File

@ -271,6 +271,8 @@ Matthias Weingart <matthias@pentax.boerde.de>
Andreas Share <a.share@t-online.de> Andreas Share <a.share@t-online.de>
for his support in keeping the Premiere World channels up to date in 'channels.conf' 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 <SemiSchwabe@Brutzel.de> Simon Bauschulte <SemiSchwabe@Brutzel.de>
for his support in keeping the Premiere World channels up to date in 'channels.conf' for his support in keeping the Premiere World channels up to date in 'channels.conf'

View File

@ -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 - The 'radio' channel icon is now only displayed in the ST:TNG skin if the channel
actually has an APID. 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). - 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).

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: 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 #ifndef __CONFIG_H
@ -20,8 +20,8 @@
#include "i18n.h" #include "i18n.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.3.12" #define VDRVERSION "1.3.13"
#define VDRVERSNUM 10312 // Version * 10000 + Major * 100 + Minor #define VDRVERSNUM 10313 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99 #define MAXPRIORITY 99
#define MAXLIFETIME 99 #define MAXLIFETIME 99

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: 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" #include "sections.h"
@ -46,6 +46,7 @@ cSectionHandler::cSectionHandler(cDevice *Device)
active = false; active = false;
statusCount = 0; statusCount = 0;
on = false; on = false;
waitForLock = false;
lastIncompleteSection = 0; lastIncompleteSection = 0;
Start(); Start();
} }
@ -145,13 +146,18 @@ void cSectionHandler::SetStatus(bool On)
{ {
Lock(); Lock();
if (on != On) { if (on != On) {
statusCount++; if (!On || device->HasLock()) {
for (cFilter *fi = filters.First(); fi; fi = filters.Next(fi)) { statusCount++;
fi->SetStatus(false); for (cFilter *fi = filters.First(); fi; fi = filters.Next(fi)) {
if (On) fi->SetStatus(false);
fi->SetStatus(true); if (On)
} fi->SetStatus(true);
on = On; }
on = On;
waitForLock = false;
}
else
waitForLock = On;
} }
Unlock(); Unlock();
} }
@ -162,6 +168,8 @@ void cSectionHandler::Action(void)
while (active) { while (active) {
Lock(); Lock();
if (waitForLock)
SetStatus(true);
int NumFilters = filterHandles.Count(); int NumFilters = filterHandles.Count();
pollfd pfd[NumFilters]; pollfd pfd[NumFilters];
for (cFilterHandle *fh = filterHandles.First(); fh; fh = filterHandles.Next(fh)) { for (cFilterHandle *fh = filterHandles.First(); fh; fh = filterHandles.Next(fh)) {

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: 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 #ifndef __SECTIONS_H
@ -27,7 +27,7 @@ private:
cDevice *device; cDevice *device;
bool active; bool active;
int statusCount; int statusCount;
bool on; bool on, waitForLock;
time_t lastIncompleteSection; time_t lastIncompleteSection;
cList<cFilter> filters; cList<cFilter> filters;
cList<cFilterHandle> filterHandles; cList<cFilterHandle> filterHandles;