summaryrefslogtreecommitdiff
path: root/dynamicdevice.c
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2012-01-04 20:14:15 +0100
committerLars Hanisch <dvb@flensrocker.de>2012-01-04 20:14:15 +0100
commit24a3868c3e176415c50f5f9e73390d9926961d45 (patch)
tree66a01ff2122874431a6baf5b76dc7c5ceb5c0632 /dynamicdevice.c
parent7c7556536b242fa8fd29a9a325427339007fda03 (diff)
downloadvdr-plugin-dynamite-24a3868c3e176415c50f5f9e73390d9926961d45.tar.gz
vdr-plugin-dynamite-24a3868c3e176415c50f5f9e73390d9926961d45.tar.bz2
avoid parsing devpath for dvb-adapter-pattern two times
Diffstat (limited to 'dynamicdevice.c')
-rw-r--r--dynamicdevice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dynamicdevice.c b/dynamicdevice.c
index b7741ee..e506f23 100644
--- a/dynamicdevice.c
+++ b/dynamicdevice.c
@@ -201,6 +201,7 @@ eDynamicDeviceReturnCode cDynamicDevice::AttachDevice(const char *DevPath, int D
cMutexLock lock(&arrayMutex);
int freeIndex = -1;
int index = -1;
+ bool isDvbDevice = false;
int adapter = -1;
int frontend = -1;
int wishIndex = -1;
@@ -209,6 +210,7 @@ eDynamicDeviceReturnCode cDynamicDevice::AttachDevice(const char *DevPath, int D
if (wishIndex >= 0)
isyslog("dynamite: %s wants card index %d", DevPath, wishIndex);
else if (sscanf(DevPath, "/dev/dvb/adapter%d/frontend%d", &adapter, &frontend) == 2) {
+ isDvbDevice = false;
wishIndex = adapter;
isyslog("dynamite: %s is a dvb adapter trying to set card index to %d", DevPath, wishIndex);
}
@@ -260,7 +262,7 @@ eDynamicDeviceReturnCode cDynamicDevice::AttachDevice(const char *DevPath, int D
}
// if it's a dvbdevice try the DvbDeviceProbes as a fallback for unpatched plugins
- if ((adapter >= 0) || (sscanf(DevPath, "/dev/dvb/adapter%d/frontend%d", &adapter, &frontend) == 2)) {
+ if (isDvbDevice || (sscanf(DevPath, "/dev/dvb/adapter%d/frontend%d", &adapter, &frontend) == 2)) {
for (cDvbDeviceProbe *dp = DvbDeviceProbes.First(); dp; dp = DvbDeviceProbes.Next(dp)) {
if (dp != dvbprobe) {
if (dp->Probe(adapter, frontend))