]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip server: rectrict pids=all requests, fixes #4620
authorJaroslav Kysela <perex@perex.cz>
Mon, 9 Oct 2017 12:21:28 +0000 (14:21 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 9 Oct 2017 13:37:51 +0000 (15:37 +0200)
From: Mono Polimorph

src/satip/rtsp.c
src/satip/server.c
src/satip/server.h

index c974e0b00bf9fbe0f401c27b64b666ea03d56c9c..d36a1afa4b738c37b4263595af8170e38700c7bf 100644 (file)
@@ -854,7 +854,16 @@ parse_pids(char *p, mpegts_apids_t *pids)
     if (x == NULL)
       break;
     if (strcmp(x, "all") == 0) {
-      pids->all = 1;
+      if (satip_server_conf.satip_restrict_pids_all) {
+        pids->all = 0;
+        for (pid = 1; pid <= 2; pid++) /* CAT, TSDT */
+           mpegts_pid_add(pids, pid, MPS_WEIGHT_RAW);
+        for (pid = 0x10; pid < 0x20; pid++) /* NIT ... SIT */
+           mpegts_pid_add(pids, pid, MPS_WEIGHT_RAW);
+        mpegts_pid_add(pids, 0x1ffb, MPS_WEIGHT_RAW); /* ATSC */
+      } else {
+        pids->all = 1;
+      }
     } else {
       pids->all = 0;
       pid = atoi(x);
index e6b5fdf62918a7ce5f4a7d9da9730288f42529ce..9fba20ef524940167541a4da654988fe3a66bd22 100644 (file)
@@ -677,6 +677,16 @@ const idclass_t satip_server_class = {
       .off    = offsetof(struct satip_server_conf, satip_noupnp),
       .group  = 1,
     },
+    {
+      .type   = PT_BOOL,
+      .id     = "satip_restrict_pids_all",
+      .name   = N_("Restrict \"pids=all\""),
+      .desc   = N_("Replace the full Transport Stream with a range "
+                   "0x00-0x02,0x10-0x1F,0x1FFB pids only."),
+      .off    = offsetof(struct satip_server_conf, satip_restrict_pids_all),
+      .opts   = PO_EXPERT,
+      .group  = 1,
+    },
     {
       .type   = PT_INT,
       .id     = "satip_weight",
index 054e48138236b7188c5c5c93f9897646f6197ad1..908d9291a48a60b86ae2b4acc7dfa10f1b01d07f 100644 (file)
@@ -51,6 +51,7 @@ struct satip_server_conf {
   int satip_notcp_mode;
   int satip_anonymize;
   int satip_noupnp;
+  int satip_restrict_pids_all;
   int satip_iptv_sig_level;
   int satip_force_sig_level;
   int satip_dvbs;