Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: [Patch] starting section handler after the first tune instead during vdr start
Andreas Share wrote:
>
> Hi,
>
> i have included a patch for vdr-1.3.11 (and some versions up and down) to
> avoid opening section filter before the card ist the first time tuned.
>
> This should help against problems with some cards during vdr start. I dont
> think we need section filter attached to an untuned card, maybe this help
> for some of the problems during vdr start.
The problem with this modification is the abstract cDevice can't know whether
the actual device provides any section data at all. That's why this
call is in dvbdevice.c.
Besides, even with the above change it is still not guaranteed that the
device has a lock when the section handling is started. Furthermore this
would only help with the initial startup, not with "no lock" after a later
channel switch.
However, you do, of course, have a point in that section filtering on
a device that has no lock is pretty useless. I would suggest the following
patch instead, which delays the actual setup of the filters until the
device has a lock.
Please try this and let me know whether it works as well as the original
suggestion.
Klaus
--- sections.h 2004/01/11 13:18:38 1.3
+++ sections.h 2004/08/08 13:44:17
@@ -27,7 +27,7 @@
cDevice *device;
bool active;
int statusCount;
- bool on;
+ bool on, waitForLock;
time_t lastIncompleteSection;
cList<cFilter> filters;
cList<cFilterHandle> filterHandles;
--- sections.c 2004/07/17 14:26:32 1.7
+++ sections.c 2004/08/08 13:59:08
@@ -46,6 +46,7 @@
active = false;
statusCount = 0;
on = false;
+ waitForLock = false;
lastIncompleteSection = 0;
Start();
}
@@ -145,13 +146,18 @@
{
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 @@
while (active) {
Lock();
+ if (waitForLock)
+ SetStatus(true);
int NumFilters = filterHandles.Count();
pollfd pfd[NumFilters];
for (cFilterHandle *fh = filterHandles.First(); fh; fh = filterHandles.Next(fh)) {
Home |
Main Index |
Thread Index