Added subsystem id support for DVB devices connected via USB

This commit is contained in:
Klaus Schmidinger 2015-01-12 11:42:15 +01:00
parent 77340e9273
commit 6514649439
3 changed files with 20 additions and 1 deletions

View File

@ -2618,6 +2618,7 @@ Jose Alberto Reguero <jareguero@telefonica.net>
for a patch that fixed part of a crash in i18n character set conversion 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 fixing cDvbPlayer::NextFile() to handle files larger than 2GB
for implementing full handling of the stream types of Dolby Digital pids 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 <staudt@engsystem.net> Patrice Staudt <staudt@engsystem.net>
for adding full weekday names to i18n.c for plugins to use for adding full weekday names to i18n.c for plugins to use

View File

@ -8344,3 +8344,5 @@ Video Disk Recorder Revision History
- Fixed support for systemd (thanks to Christopher Reimer). - Fixed support for systemd (thanks to Christopher Reimer).
- Added a missing backslash to the help text of the SVDRP command MOVR (thanks to - Added a missing backslash to the help text of the SVDRP command MOVR (thanks to
Lars Hanisch). Lars Hanisch).
- Added subsystem id support for DVB devices connected via USB (thanks to Jose
Alberto Reguero).

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.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" #include "dvbdevice.h"
@ -1751,12 +1751,28 @@ uint32_t cDvbDeviceProbe::GetSubsystemId(int Adapter, int Frontend)
SubsystemId = strtoul(s, NULL, 0) << 16; SubsystemId = strtoul(s, NULL, 0) << 16;
fclose(f); 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); FileName = cString::sprintf("/sys/class/dvb/%s/device/subsystem_device", e->d_name);
if ((f = fopen(FileName, "r")) != NULL) { if ((f = fopen(FileName, "r")) != NULL) {
if (char *s = ReadLine.Read(f)) if (char *s = ReadLine.Read(f))
SubsystemId |= strtoul(s, NULL, 0); SubsystemId |= strtoul(s, NULL, 0);
fclose(f); 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; break;
} }
} }