summaryrefslogtreecommitdiff
path: root/sections.c
diff options
context:
space:
mode:
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)) {