From patchwork Sat Sep 25 14:38:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: syrius.ml@no-log.org X-Patchwork-Id: 12833 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.69) (envelope-from ) id 1OzVtp-0002yf-3f for vdr@linuxtv.org; Sat, 25 Sep 2010 16:38:49 +0200 X-tubIT-Incoming-IP: 212.27.42.6 Received: from smtp6-g21.free.fr ([212.27.42.6]) by mail.tu-berlin.de (exim-4.69/mailfrontend-d) with esmtp for id 1OzVto-0001Mh-1b; Sat, 25 Sep 2010 16:38:48 +0200 Received: from odo (unknown [78.226.16.213]) by smtp6-g21.free.fr (Postfix) with ESMTP id BE8918235E for ; Sat, 25 Sep 2010 16:38:41 +0200 (CEST) From: syrius.ml@no-log.org To: vdr@linuxtv.org Message-ID: <8762xt520c.874odd520c@8739sx520c.message.id> Date: Sat, 25 Sep 2010 16:38:39 +0200 User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 X-tubIT-Score: 0.0 () X-PMX-Version: 5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.9.25.143016 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1900_1999 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, NO_REAL_NAME 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_BLIZZARD_RCVD 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __USER_AGENT 0' X-LSpam-Score: -3.6 (---) X-LSpam-Report: No, score=-3.6 required=5.0 tests=BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1 autolearn=ham Subject: [vdr] cDvbDevice::Initialize X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 14:38:49 -0000 Status: O X-Status: X-Keywords: X-UID: 23569 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