diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2014-01-01 14:26:26 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2014-01-01 14:26:26 +0100 |
commit | 9dbd953cc239afaf833b977a42f78420ec0fe45a (patch) | |
tree | c6348e771215a57c064da7f16474b17f84ed8630 /dvbdevice.c | |
parent | ea613e6b2651bedacce9413df0a9e3c80afb6c1c (diff) | |
download | vdr-9dbd953cc239afaf833b977a42f78420ec0fe45a.tar.gz vdr-9dbd953cc239afaf833b977a42f78420ec0fe45a.tar.bz2 |
Eliminated MAXDVBDEVICES
Diffstat (limited to 'dvbdevice.c')
-rw-r--r-- | dvbdevice.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/dvbdevice.c b/dvbdevice.c index 3f70f20b..481489b3 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 3.6 2013/12/28 13:21:37 kls Exp $ + * $Id: dvbdevice.c 3.7 2014/01/01 14:14:32 kls Exp $ */ #include "dvbdevice.h" @@ -1204,8 +1204,8 @@ bool cDvbDevice::Initialize(void) } } } - int Checked = 0; int Found = 0; + int Used = 0; if (Nodes.Size() > 0) { Nodes.Sort(); for (int i = 0; i < Nodes.Size(); i++) { @@ -1213,10 +1213,11 @@ bool cDvbDevice::Initialize(void) int Frontend; if (2 == sscanf(Nodes[i], "%d %d", &Adapter, &Frontend)) { if (Exists(Adapter, Frontend)) { - if (Checked++ < MAXDVBDEVICES) { + if (Found < MAXDEVICES) { + Found++; if (UseDevice(NextCardIndex())) { if (Probe(Adapter, Frontend)) - Found++; + Used++; } else NextCardIndex(1); // skips this one @@ -1225,9 +1226,11 @@ bool cDvbDevice::Initialize(void) } } } - NextCardIndex(MAXDVBDEVICES - Checked); // skips the rest - if (Found > 0) + if (Found > 0) { isyslog("found %d DVB device%s", Found, Found > 1 ? "s" : ""); + if (Used != Found) + isyslog("using only %d DVB device%s", Used, Used > 1 ? "s" : ""); + } else isyslog("no DVB device found"); return Found > 0; |