diff options
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | README | 10 | ||||
-rw-r--r-- | dynamicdevice.c | 20 | ||||
-rw-r--r-- | dynamicdevice.h | 1 | ||||
-rw-r--r-- | dynamite.c | 2 |
5 files changed, 36 insertions, 1 deletions
@@ -244,3 +244,7 @@ VDR Plugin 'dynamite' Revision History 2011-12-21: Version 0.0.9a - reset CAMs if device will not get ready on attach + +2012-02-05: Version 0.0.9b + +- add udev attribute "dynamite_sources" which will limit the reception of the device to the given sources @@ -298,6 +298,7 @@ ACTION=="add", SUBSYSTEM=="dvb", ENV{DVB_DEVICE_TYPE}=="frontend" \ , ENV{dynamite_attach_delay}="10" \ , ENV{dynamite_instanceid}="0" \ , ENV{dynamite_cardindex}="5" \ + , ENV{dynamite_sources}="C,T" \ , ENV{dynamite_timeout}="10" \ , ENV{dynamite_timeout_handler_arg}="%k" \ , ENV{dynamite_disable_autoidle}="no" @@ -329,6 +330,15 @@ dynamite_disable_autoidle string or missing of this property will activate the auto-idle feature if configured +dynamite_sources + comma separated list of strings from sources.conf + dynamite will deny all channels from other sources for the subdevice. + If this variable is missing the subdevice is asked as usual. + This is useful for hybrid devices which supports multiple delivery systems + but only one is connected. Or if you have to dishes to different satellites + connected to two cards. + It will NOT switch the delivery system on dvb-cards, this is up to the device itself! + dynamite_timeout n: set GetTS timeout in seconds on this device diff --git a/dynamicdevice.c b/dynamicdevice.c index ae0cab3..a594438 100644 --- a/dynamicdevice.c +++ b/dynamicdevice.c @@ -562,6 +562,7 @@ cDynamicDevice::cDynamicDevice() ,subDeviceIsReady(false) ,devpath(NULL) ,udevRemoveSyspath(NULL) +,udevProvidesSources(NULL) ,getTSTimeoutHandlerArg(NULL) ,isDetachable(true) ,getTSTimeout(defaultGetTSTimeout) @@ -612,6 +613,13 @@ void cDynamicDevice::ReadUdevProperties(void) || (strcmp(disableAutoIdleArg, "1") == 0))) disableAutoIdle = true; + const char *providesSources = dev->GetPropertyValue("dynamite_sources"); + if (providesSources) { + if (udevProvidesSources) + delete udevProvidesSources; + udevProvidesSources = new cString(cString::sprintf(",%s,", providesSources)); + } + cUdevDevice *p = dev->GetParent(); if (p) { const char *subsystem = p->GetSubsystem(); @@ -672,6 +680,10 @@ void cDynamicDevice::DeleteSubDevice() delete udevRemoveSyspath; udevRemoveSyspath = NULL; } + if (udevProvidesSources) { + delete udevProvidesSources; + udevProvidesSources = NULL; + } if (devpath) { delete devpath; devpath = NULL; @@ -795,6 +807,14 @@ 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 (subDevice) return subDevice->ProvidesSource(Source); return cDevice::ProvidesSource(Source); diff --git a/dynamicdevice.h b/dynamicdevice.h index 881a1ce..efb44cc 100644 --- a/dynamicdevice.h +++ b/dynamicdevice.h @@ -72,6 +72,7 @@ private: bool subDeviceIsReady; cString *devpath; cString *udevRemoveSyspath; + cString *udevProvidesSources; cString *getTSTimeoutHandlerArg; bool isDetachable; time_t getTSWatchdog; @@ -11,7 +11,7 @@ #include "monitor.h" #include "status.h" -static const char *VERSION = "0.0.9a"; +static const char *VERSION = "0.0.9b"; static const char *DESCRIPTION = tr("attach/detach devices on the fly"); static const char *MAINMENUENTRY = NULL; |