]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP Client: add network_group
authorJaroslav Kysela <perex@perex.cz>
Fri, 18 Mar 2016 10:22:07 +0000 (11:22 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 18 Mar 2016 10:31:28 +0000 (11:31 +0100)
src/input/mpegts/satip/satip_private.h
src/input/mpegts/satip/satip_satconf.c

index 59a6d1c62578a1ce278401405b5adcc1441e50e3..a829f457e6c80515c59590009782b891507551f2 100644 (file)
@@ -184,6 +184,7 @@ struct satip_satconf
   int                        sfc_grace;
   char                      *sfc_name;
   int                        sfc_network_limit;
+  int                        sfc_network_group;
 
   /*
    * Assigned networks to this SAT configuration
index 7fd96c9f617b068b1d761299fa9544b029b2ca17..d835f5a0b848c4f1ecd664fc1993b51d6d92ec70 100644 (file)
@@ -75,9 +75,15 @@ satip_satconf_check_network_limit
 
   count = 0;
   TAILQ_FOREACH(lfe2, &lfe->sf_device->sd_frontends, sf_link)
-    TAILQ_FOREACH(sfc2, &lfe2->sf_satconf, sfc_link)
-      if (idnode_set_exists(sfc->sfc_networks, mn) && lfe2->sf_running)
+    TAILQ_FOREACH(sfc2, &lfe2->sf_satconf, sfc_link) {
+      if (!lfe2->sf_running) continue;
+      if (sfc->sfc_network_group > 0 &&
+          sfc2->sfc_network_group > 0 &&
+          sfc2->sfc_network_group == sfc->sfc_network_group)
         count++;
+      else if (idnode_set_exists(sfc2->sfc_networks, mn))
+        count++;
+    }
 
   return count <= sfc->sfc_network_limit;
 }
@@ -256,13 +262,21 @@ const idclass_t satip_satconf_class =
       .type     = PT_INT,
       .id       = "network_limit",
       .name     = N_("Network limit per position"),
-      .desc     = N_("A comma separated list with tuner limits per network "
-                     "position (src=) for satellite SAT>IP tuners. "
+      .desc     = N_("Concurrent limit per network position (src=) "
+                     "for satellite SAT>IP tuners. "
                      "The first limit number is for src=1 (AA), second "
                      "for src=2 (AB) etc."),
       .opts     = PO_EXPERT,
       .off      = offsetof(satip_satconf_t, sfc_network_limit),
     },
+    {
+      .type     = PT_INT,
+      .id       = "network_group",
+      .name     = N_("Network group"),
+      .desc     = N_("Define network group to limit network usage."),
+      .opts     = PO_EXPERT,
+      .off      = offsetof(satip_satconf_t, sfc_network_group),
+    },
     {
       .type     = PT_STR,
       .id       = "networks",