summaryrefslogtreecommitdiff
path: root/sections.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-08-08 14:12:43 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2004-08-08 14:12:43 +0200
commit30da608c70f2a7ff23bfdf49c158630ed57d0bf2 (patch)
tree94d4c98690580b1179cfc6ff4242ae69974be8a8 /sections.c
parent4a72fd75c2c7ddff479dc4783036672db79512b1 (diff)
downloadvdr-30da608c70f2a7ff23bfdf49c158630ed57d0bf2.tar.gz
vdr-30da608c70f2a7ff23bfdf49c158630ed57d0bf2.tar.bz2
Making sure section filters are only set if the device actually has a lock
Diffstat (limited to 'sections.c')
-rw-r--r--sections.c24
1 files changed, 16 insertions, 8 deletions
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)) {