From 6514649439e7a0209945c70b7da10d6f0e4cb0ae Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 12 Jan 2015 11:42:15 +0100 Subject: Added subsystem id support for DVB devices connected via USB --- CONTRIBUTORS | 1 + HISTORY | 2 ++ dvbdevice.c | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 63a0eff1..2a33837a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2618,6 +2618,7 @@ Jose Alberto Reguero for a patch that fixed part of a crash in i18n character set conversion for fixing cDvbPlayer::NextFile() to handle files larger than 2GB for implementing full handling of the stream types of Dolby Digital pids + for adding subsystem id support for DVB devices connected via USB Patrice Staudt for adding full weekday names to i18n.c for plugins to use diff --git a/HISTORY b/HISTORY index 9d3d88d1..c6368dce 100644 --- a/HISTORY +++ b/HISTORY @@ -8344,3 +8344,5 @@ Video Disk Recorder Revision History - Fixed support for systemd (thanks to Christopher Reimer). - Added a missing backslash to the help text of the SVDRP command MOVR (thanks to Lars Hanisch). +- Added subsystem id support for DVB devices connected via USB (thanks to Jose + Alberto Reguero). diff --git a/dvbdevice.c b/dvbdevice.c index fb406f1a..da97567a 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.11 2014/03/16 10:38:31 kls Exp $ + * $Id: dvbdevice.c 3.12 2015/01/12 11:24:51 kls Exp $ */ #include "dvbdevice.h" @@ -1751,12 +1751,28 @@ uint32_t cDvbDeviceProbe::GetSubsystemId(int Adapter, int Frontend) SubsystemId = strtoul(s, NULL, 0) << 16; fclose(f); } + else { + FileName = cString::sprintf("/sys/class/dvb/%s/device/idVendor", e->d_name); + if ((f = fopen(FileName, "r")) != NULL) { + if (char *s = ReadLine.Read(f)) + SubsystemId = strtoul(s, NULL, 16) << 16; + fclose(f); + } + } FileName = cString::sprintf("/sys/class/dvb/%s/device/subsystem_device", e->d_name); if ((f = fopen(FileName, "r")) != NULL) { if (char *s = ReadLine.Read(f)) SubsystemId |= strtoul(s, NULL, 0); fclose(f); } + else { + FileName = cString::sprintf("/sys/class/dvb/%s/device/idProduct", e->d_name); + if ((f = fopen(FileName, "r")) != NULL) { + if (char *s = ReadLine.Read(f)) + SubsystemId |= strtoul(s, NULL, 16); + fclose(f); + } + } break; } } -- cgit v1.2.3