Eliminated MAXDVBDEVICES

This commit is contained in:
Klaus Schmidinger 2014-01-01 14:26:26 +01:00
parent ea613e6b26
commit 9dbd953cc2
4 changed files with 12 additions and 8 deletions

View File

@ -704,6 +704,7 @@ Oliver Endriss <o.endriss@gmx.de>
for reporting a problem with resuming replay of PES recordings for reporting a problem with resuming replay of PES recordings
for suggesting to make all bonded devices (except for the master) turn off their LNB for suggesting to make all bonded devices (except for the master) turn off their LNB
power completely to avoid problems when receiving vertically polarized transponders power completely to avoid problems when receiving vertically polarized transponders
for suggesting to eliminate MAXDVBDEVICES
Reinhard Walter Buchner <rw.buchner@freenet.de> Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf' for adding some satellites to 'sources.conf'

View File

@ -8109,3 +8109,4 @@ Video Disk Recorder Revision History
Plugin authors may want to apply the following change to their Makefile: Plugin authors may want to apply the following change to their Makefile:
-PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) -PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
+PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr)) +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr))
- Eliminated MAXDVBDEVICES (suggested by Oliver Endriss).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbdevice.h"
@ -1204,8 +1204,8 @@ bool cDvbDevice::Initialize(void)
} }
} }
} }
int Checked = 0;
int Found = 0; int Found = 0;
int Used = 0;
if (Nodes.Size() > 0) { if (Nodes.Size() > 0) {
Nodes.Sort(); Nodes.Sort();
for (int i = 0; i < Nodes.Size(); i++) { for (int i = 0; i < Nodes.Size(); i++) {
@ -1213,10 +1213,11 @@ bool cDvbDevice::Initialize(void)
int Frontend; int Frontend;
if (2 == sscanf(Nodes[i], "%d %d", &Adapter, &Frontend)) { if (2 == sscanf(Nodes[i], "%d %d", &Adapter, &Frontend)) {
if (Exists(Adapter, Frontend)) { if (Exists(Adapter, Frontend)) {
if (Checked++ < MAXDVBDEVICES) { if (Found < MAXDEVICES) {
Found++;
if (UseDevice(NextCardIndex())) { if (UseDevice(NextCardIndex())) {
if (Probe(Adapter, Frontend)) if (Probe(Adapter, Frontend))
Found++; Used++;
} }
else else
NextCardIndex(1); // skips this one 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" : ""); 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 else
isyslog("no DVB device found"); isyslog("no DVB device found");
return Found > 0; return Found > 0;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbdevice.h 3.2 2013/06/01 11:36:18 kls Exp $ * $Id: dvbdevice.h 3.3 2014/01/01 14:00:56 kls Exp $
*/ */
#ifndef __DVBDEVICE_H #ifndef __DVBDEVICE_H
@ -67,7 +67,6 @@ enum {
// --- End of definitions for older DVB API versions ------------------------- // --- End of definitions for older DVB API versions -------------------------
#define MAXDVBDEVICES 8
#define MAXDELIVERYSYSTEMS 8 #define MAXDELIVERYSYSTEMS 8
#define DEV_VIDEO "/dev/video" #define DEV_VIDEO "/dev/video"