diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-08-08 14:12:43 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-08-08 14:12:43 +0200 |
commit | 30da608c70f2a7ff23bfdf49c158630ed57d0bf2 (patch) | |
tree | 94d4c98690580b1179cfc6ff4242ae69974be8a8 /sections.c | |
parent | 4a72fd75c2c7ddff479dc4783036672db79512b1 (diff) | |
download | vdr-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.c | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -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)) { |