summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/vdr.c b/vdr.c
index 86becfe0..f05ecfa0 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.147 2003/03/30 10:43:58 kls Exp $
+ * $Id: vdr.c 1.148 2003/04/12 12:17:32 kls Exp $
*/
#include <getopt.h>
@@ -364,21 +364,32 @@ int main(int argc, char *argv[])
// Primary device:
cDevice::SetPrimaryDevice(Setup.PrimaryDVB);
- if (!cDevice::PrimaryDevice()) {
+ if (!cDevice::PrimaryDevice() || !cDevice::PrimaryDevice()->HasDecoder()) {
+ if (cDevice::PrimaryDevice() && !cDevice::PrimaryDevice()->HasDecoder())
+ isyslog("device %d has no MPEG decoder", cDevice::PrimaryDevice()->DeviceNumber() + 1);
for (int i = 0; i < cDevice::NumDevices(); i++) {
cDevice *d = cDevice::GetDevice(i);
if (d && d->HasDecoder()) {
isyslog("trying device number %d instead", i + 1);
- if (cDevice::SetPrimaryDevice(i + 1))
+ if (cDevice::SetPrimaryDevice(i + 1)) {
Setup.PrimaryDVB = i + 1;
+ break;
+ }
}
}
- }
- if (!cDevice::PrimaryDevice()) {
- const char *msg = "no primary device found - giving up!";
- fprintf(stderr, "vdr: %s\n", msg);
- esyslog("ERROR: %s", msg);
- return 2;
+ if (!cDevice::PrimaryDevice()) {
+ const char *msg = "no primary device found - using first device!";
+ fprintf(stderr, "vdr: %s\n", msg);
+ esyslog("ERROR: %s", msg);
+ if (!cDevice::SetPrimaryDevice(0))
+ return 2;
+ if (!cDevice::PrimaryDevice()) {
+ const char *msg = "no primary device found - giving up!";
+ fprintf(stderr, "vdr: %s\n", msg);
+ esyslog("ERROR: %s", msg);
+ return 2;
+ }
+ }
}
// OSD: