Hi,

I'm having a setup with 4 dvb cards, and I'm running 3 vdr instances.
I'm using an udev rules to make sure adapter numbers don't change.
I'm using the -D option the assign cards to vdr instances.

I've just discovered that vdr -D 3 would not use the adapter 3 if
adapter2 was missing from /dev/dvb/.

Here is the patch i'm testing to correct this issue, feel free to
comment.

--- dvbdevice.c.orig	2010-09-25 16:29:09.341396415 +0200
+++ dvbdevice.c	2010-09-25 16:25:37.087849316 +0200
@@ -786,29 +786,18 @@
   new cDvbSourceParam('C', "DVB-C");
   new cDvbSourceParam('S', "DVB-S");
   new cDvbSourceParam('T', "DVB-T");
-  int Checked = 0;
   int Found = 0;
-  for (int Adapter = 0; ; Adapter++) {
-      for (int Frontend = 0; ; Frontend++) {
-          if (Exists(Adapter, Frontend)) {
-             if (Checked++ < MAXDVBDEVICES) {
-                if (UseDevice(NextCardIndex())) {
-                   if (Probe(Adapter, Frontend))
-                      Found++;
-                   }
-                else
-                   NextCardIndex(1); // skips this one
-                }
-             }
-          else if (Frontend == 0)
-             goto LastAdapter;
-          else
-             goto NextAdapter;
-          }
-      NextAdapter: ;
-      }
-LastAdapter:
-  NextCardIndex(MAXDVBDEVICES - Checked); // skips the rest
+  for (int Adapter = 0; Adapter <= MAXDVBDEVICES; Adapter++) {
+     if (UseDevice(NextCardIndex())) {
+        for (int Frontend = 0; Exists(Adapter, Frontend); Frontend++) {
+           if (Probe(Adapter, Frontend)) {
+              Found++;
+           }
+        }
+     } else {
+        NextCardIndex(1); // skips this one
+     }
+  }
   if (Found > 0)
      isyslog("found %d DVB device%s", Found, Found > 1 ? "s" : "");
   else

-- 
_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to