summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2012-02-05 16:01:45 +0100
committerLars Hanisch <dvb@flensrocker.de>2012-02-05 16:01:45 +0100
commit919248abb37a9a29460fd743bce620cf208e28f9 (patch)
tree1b3f5648805a9a3e8d8b9d517e6c5d0e6d3b74a5
parente1e34f97b97f51cd724cc44b41bfb160f1867d18 (diff)
downloadvdr-plugin-dynamite-919248abb37a9a29460fd743bce620cf208e28f9.tar.gz
vdr-plugin-dynamite-919248abb37a9a29460fd743bce620cf208e28f9.tar.bz2
test udev-allowed source at ProvidesChannelv0.0.9b
-rw-r--r--dynamicdevice.c29
-rw-r--r--dynamicdevice.h1
2 files changed, 22 insertions, 8 deletions
diff --git a/dynamicdevice.c b/dynamicdevice.c
index a594438..6845e1c 100644
--- a/dynamicdevice.c
+++ b/dynamicdevice.c
@@ -661,6 +661,19 @@ void cDynamicDevice::InternSetLock(bool Lock)
isyslog("dynamite: %slocked device %s", Lock ? "" : "un", GetDevPath());
}
+bool cDynamicDevice::InternProvidesSource(int Source) const
+{
+ if (udevProvidesSources) {
+ cString source = cSource::ToString(Source);
+ cString search = cString::sprintf(",%s,", *source);
+ if (strstr(**udevProvidesSources, *search) == NULL) {
+ isyslog("dynamite: device %s shall not provide source %s", GetDevPath(), *source);
+ return false;
+ }
+ }
+ return true;
+}
+
void cDynamicDevice::DeleteSubDevice()
{
subDeviceIsReady = false;
@@ -807,14 +820,8 @@ void cDynamicDevice::CloseFilter(int Handle)
bool cDynamicDevice::ProvidesSource(int Source) const
{
- if (udevProvidesSources) {
- cString source = cSource::ToString(Source);
- cString search = cString::sprintf(",%s,", *source);
- if (strstr(**udevProvidesSources, *search) == NULL) {
- isyslog("dynamite: device %s shall not provide source %s", GetDevPath(), *source);
- return false;
- }
- }
+ if (!InternProvidesSource(Source))
+ return false;
if (subDevice)
return subDevice->ProvidesSource(Source);
return cDevice::ProvidesSource(Source);
@@ -822,6 +829,8 @@ bool cDynamicDevice::ProvidesSource(int Source) const
bool cDynamicDevice::ProvidesTransponder(const cChannel *Channel) const
{
+ if (!InternProvidesSource(Channel->Source()))
+ return false;
if (subDevice)
return subDevice->ProvidesTransponder(Channel);
return cDevice::ProvidesTransponder(Channel);
@@ -829,6 +838,8 @@ bool cDynamicDevice::ProvidesTransponder(const cChannel *Channel) const
bool cDynamicDevice::ProvidesTransponderExclusively(const cChannel *Channel) const
{
+ if (!InternProvidesSource(Channel->Source()))
+ return false;
if (subDevice)
return subDevice->ProvidesTransponderExclusively(Channel);
return cDevice::ProvidesTransponderExclusively(Channel);
@@ -836,6 +847,8 @@ bool cDynamicDevice::ProvidesTransponderExclusively(const cChannel *Channel) con
bool cDynamicDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
{
+ if (!InternProvidesSource(Channel->Source()))
+ return false;
if (subDevice)
return subDevice->ProvidesChannel(Channel, Priority, NeedsDetachReceivers);
return cDevice::ProvidesChannel(Channel, Priority, NeedsDetachReceivers);
diff --git a/dynamicdevice.h b/dynamicdevice.h
index efb44cc..4c4ac1c 100644
--- a/dynamicdevice.h
+++ b/dynamicdevice.h
@@ -84,6 +84,7 @@ private:
void InternSetGetTSTimeout(int Seconds);
void InternSetGetTSTimeoutHandlerArg(const char *Arg);
void InternSetLock(bool Lock);
+ bool InternProvidesSource(int Source) const;
public:
cDynamicDevice();
const char *GetDevPath(void) const;