[vdr] Request: E parameter in channels.conf for epg scan

Rolf Ahrenberg rahrenbe at cc.hut.fi
Mon Dec 6 16:48:34 CET 2010


On Mon, 6 Dec 2010, Mario Schulz wrote:

> Am 05.12.2010 23:33, schrieb Klaus Schmidinger:
>> What would that be necessary for?

I'd like to prevent EIT scans on IPTV devices.

> In its default behaviour VDR will add transponders and channels to the
> channels.conf, as a result these will be searched and probably result in
> a match and a timer entry, even for uninteresting or undecodable channels.

The following patch might expose the necessary API for plugins to create 
white and/or blacklists for EIT scanning on certain devices/channels.

BR,
--
rofa

diff -Nru vdr-1.7.16-vanilla/device.c vdr-1.7.16-eitscan/device.c
--- vdr-1.7.16-vanilla/device.c	2010-09-19 19:42:08.000000000 +0300
+++ vdr-1.7.16-eitscan/device.c	2010-12-06 17:36:33.000000000 +0200
@@ -56,6 +56,11 @@
    return true;
  }

+bool cDeviceHook::DeviceProvidesEITScan(const cDevice *Device, const cChannel *Channel) const
+{
+  return true;
+}
+
  // --- cDevice ---------------------------------------------------------------

  // The default priority for non-primary devices:
@@ -594,6 +599,17 @@
    return true;
  }

+bool cDevice::DeviceHooksProvidesEITScan(const cChannel *Channel) const
+{
+  cDeviceHook *Hook = deviceHooks.First();
+  while (Hook) {
+        if (!Hook->DeviceProvidesEITScan(this, Channel))
+           return false;
+        Hook = deviceHooks.Next(Hook);
+        }
+  return true;
+}
+
  bool cDevice::ProvidesTransponder(const cChannel *Channel) const
  {
    return false;
diff -Nru vdr-1.7.16-vanilla/device.h vdr-1.7.16-eitscan/device.h
--- vdr-1.7.16-vanilla/device.h	2010-09-19 19:42:08.000000000 +0300
+++ vdr-1.7.16-eitscan/device.h	2010-12-06 17:41:18.000000000 +0200
@@ -96,6 +96,8 @@
            ///< program ends.
    virtual bool DeviceProvidesTransponder(const cDevice *Device, const cChannel *Channel) const;
            ///< Returns true if the given Device can provide the given Channel's transponder.
+  virtual bool DeviceProvidesEITScan(const cDevice *Device, const cChannel *Channel) const;
+          ///< Returns true if the given Device can scan EIT on the given Channel's transponder.
    };

  /// The cDevice class is the base from which actual devices can be derived.
@@ -204,6 +206,8 @@
    static cList<cDeviceHook> deviceHooks;
  protected:
    bool DeviceHooksProvidesTransponder(const cChannel *Channel) const;
+public:
+  bool DeviceHooksProvidesEITScan(const cChannel *Channel) const;

  // SPU facilities

diff -Nru vdr-1.7.16-vanilla/eitscan.c vdr-1.7.16-eitscan/eitscan.c
--- vdr-1.7.16-vanilla/eitscan.c	2010-09-19 19:42:08.000000000 +0300
+++ vdr-1.7.16-eitscan/eitscan.c	2010-12-06 17:38:40.000000000 +0200
@@ -146,7 +146,7 @@
                 if (Device) {
                    for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) {
                        const cChannel *Channel = ScanData->GetChannel();
-                      if (Channel) {
+                      if (Channel && Device->DeviceHooksProvidesEITScan(Channel)) {
                           if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= CA_ENCRYPTED_MIN) {
                              if (Device->ProvidesTransponder(Channel)) {
                                 if (!Device->Receiving()) {





More information about the vdr mailing list