]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP client: always use pids=0 for SETUP, issue #4809
authorJaroslav Kysela <perex@perex.cz>
Sat, 23 Dec 2017 15:21:24 +0000 (16:21 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 25 Dec 2017 17:09:01 +0000 (18:09 +0100)
src/input/mpegts/satip/satip.c
src/input/mpegts/satip/satip_frontend.c
src/input/mpegts/satip/satip_private.h
src/input/mpegts/satip/satip_rtsp.c

index 62234dabe2dc82c2568f99e1089ecb062d4dcede..c195c17beaf3716f27b0b0176f5e4f28e36bd3ae 100644 (file)
@@ -313,15 +313,6 @@ const idclass_t satip_device_class =
       .opts     = PO_ADVANCED,
       .off      = offsetof(satip_device_t, sd_pids_deladd),
     },
-    {
-      .type     = PT_BOOL,
-      .id       = "pids0",
-      .name     = N_("PIDs in setup"),
-      .desc     = N_("Enable if the SAT>IP box requires pids=0 parameter "
-                     "in the SETUP RTSP command."),
-      .opts     = PO_ADVANCED,
-      .off      = offsetof(satip_device_t, sd_pids0),
-    },
     {
       .type     = PT_BOOL,
       .id       = "piloton",
@@ -559,7 +550,6 @@ satip_device_hack( satip_device_t *sd )
 #endif
   if (strstr(sd->sd_info.location, ":8888/octonet.xml")) {
     /* OctopusNet requires pids in the SETUP RTSP command */
-    sd->sd_pids0       = 1;
   } else if (strstr(sd->sd_info.manufacturer, "Triax") &&
              strstr(sd->sd_info.modelname, "TSS400")) {
     sd->sd_pilot_on    = 1;
@@ -573,8 +563,7 @@ satip_device_hack( satip_device_t *sd )
              strstr(sd->sd_info.modelname, "FRITZ!")) {
     sd->sd_fullmux_ok  = 0;
     sd->sd_pids_deladd = 0;
-    sd->sd_pids0       = 1;
-    sd->sd_pids21       = 1;
+    sd->sd_pids21      = 1;
   }
 }
 
index 86aa3504c164e1fd78908da871b956b4e7627fb8..23ef25c8a5ba04ff1ea9ea3f22a7a13a3711b92e 100644 (file)
@@ -714,8 +714,7 @@ satip_frontend_update_pids
           mpegts_pid_add(&tr->sf_pids, mp->mp_pid, mps->mps_weight);
       }
     }
-    if (lfe->sf_device->sd_pids0)
-      mpegts_pid_add(&tr->sf_pids, 0, MPS_WEIGHT_PMT_SCAN);
+    mpegts_pid_add(&tr->sf_pids, 0, MPS_WEIGHT_PMT_SCAN);
     if (lfe->sf_device->sd_pids21)
       mpegts_pid_add(&tr->sf_pids, 21, MPS_WEIGHT_PMT_SCAN);
   }
@@ -910,8 +909,8 @@ satip_frontend_pid_changed( http_client_t *rtsp,
 {
   satip_tune_req_t *tr;
   satip_device_t *sd = lfe->sf_device;
-  char *add, *del;
-  int i, j, r;
+  char *setup = NULL, *add = NULL, *del = NULL;
+  int i, j, r, pid;
   int max_pids_len = sd->sd_pids_len;
   int max_pids_count = sd->sd_pids_max;
   mpegts_apids_t wpid, padd, pdel;
@@ -934,10 +933,7 @@ all:
     pthread_mutex_unlock(&lfe->sf_dvr_lock);
     if (i)
       goto skip;
-
-    tr->sf_weight_tuned = tr->sf_weight;
-    r = satip_rtsp_play(rtsp, "all", NULL, NULL, max_pids_len, tr->sf_weight);
-    r = r == 0 ? 1 : r;
+    setup = (char *)"all";
 
   } else if (!sd->sd_pids_deladd ||
              tr->sf_pids_tuned.all ||
@@ -951,22 +947,18 @@ all:
     }
 
     j = MIN(wpid.count, max_pids_count);
-    add = alloca(1 + j * 5);
-    add[0] = '\0';
+    setup = alloca(1 + j * 5);
+    setup[0] = '\0';
     for (i = 0; i < j; i++)
-      sprintf(add + strlen(add), ",%i", wpid.pids[i].pid);
+      sprintf(setup + strlen(setup), ",%i", wpid.pids[i].pid);
     mpegts_pid_copy(&tr->sf_pids_tuned, &wpid);
     tr->sf_pids_tuned.all = 0;
     pthread_mutex_unlock(&lfe->sf_dvr_lock);
     mpegts_pid_done(&wpid);
 
-    if (!j || add[0] == '\0')
+    if (!j || setup[0] == '\0')
       goto skip;
 
-    tr->sf_weight_tuned = tr->sf_weight;
-    r = satip_rtsp_play(rtsp, add, NULL, NULL, max_pids_len, tr->sf_weight);
-    r = r == 0 ? 1 : r;
-
   } else {
 
     mpegts_pid_weighted(&wpid, &tr->sf_pids, max_pids_count);
@@ -983,13 +975,17 @@ all:
     add[0] = del[0] = '\0';
 
     for (i = 0; i < pdel.count; i++) {
-      sprintf(del + strlen(del), ",%i", pdel.pids[i].pid);
-      mpegts_pid_del(&tr->sf_pids_tuned, pdel.pids[i].pid, pdel.pids[i].weight);
+      pid = pdel.pids[i].pid;
+      if (pid != DVB_PAT_PID)
+        sprintf(del + strlen(del), ",%i", pid);
     }
 
     j = MIN(padd.count, max_pids_count);
-    for (i = 0; i < j; i++)
-      sprintf(add + strlen(add), ",%i", padd.pids[i].pid);
+    for (i = 0; i < j; i++) {
+      pid = padd.pids[i].pid;
+      if (pid != DVB_PAT_PID)
+        sprintf(add + strlen(add), ",%i", pid);
+    }
 
     mpegts_pid_copy(&tr->sf_pids_tuned, &wpid);
     tr->sf_pids_tuned.all = 0;
@@ -1001,12 +997,12 @@ all:
 
     if (add[0] == '\0' && del[0] == '\0')
       goto skip;
-
-    tr->sf_weight_tuned = tr->sf_weight;
-    r = satip_rtsp_play(rtsp, NULL, add, del, max_pids_len, tr->sf_weight);
-    r = r == 0 ? 1 : r;
   }
 
+  tr->sf_weight_tuned = tr->sf_weight;
+  r = satip_rtsp_play(rtsp, setup, add, del, max_pids_len, tr->sf_weight);
+  r = r == 0 ? 1 : r;
+
   if (r < 0)
     tvherror(LS_SATIP, "%s - failed to modify pids: %s", name, strerror(-r));
   return r;
@@ -1646,8 +1642,6 @@ new_tune:
   rtsp->hc_efd = efd;
 
   position = lfe_master->sf_position;
-  if (lfe->sf_device->sd_pids0)
-    rtsp_flags |= SATIP_SETUP_PIDS0;
   if (lfe->sf_device->sd_pilot_on)
     rtsp_flags |= SATIP_SETUP_PILOT_ON;
   if (lfe->sf_device->sd_pids21)
index d32f032f102bb7a123bbccac8114ff71671802bd..0d601f48c2e382afbd9cc48e5d2bb9e0c1bc812b 100644 (file)
@@ -87,7 +87,6 @@ struct satip_device
   int                        sd_pids_len;
   int                        sd_pids_deladd;
   int                        sd_sig_scale;
-  int                        sd_pids0;
   char                      *sd_tunercfg;
   int                        sd_pids21;
   int                        sd_pilot_on;
@@ -271,9 +270,8 @@ satip_satconf_t *satip_satconf_get_position
 
 #define SATIP_SETUP_TCP      (1<<0)
 #define SATIP_SETUP_PLAY     (1<<1)
-#define SATIP_SETUP_PIDS0    (1<<2)
-#define SATIP_SETUP_PILOT_ON (1<<3)
-#define SATIP_SETUP_PIDS21   (1<<4)
+#define SATIP_SETUP_PILOT_ON (1<<2)
+#define SATIP_SETUP_PIDS21   (1<<3)
 
 int
 satip_rtsp_setup( http_client_t *hc,
index 71abaa1d268fa9489447c34c60968b4e4835c1ef..bc57d19ac37a47d4d3d317e4940e577919a93847 100644 (file)
@@ -227,13 +227,10 @@ satip_rtsp_setup( http_client_t *hc, int src, int fe,
   }
   if (weight > 0)
     satip_rtsp_add_val("tvhweight", buf, (uint32_t)weight * 1000);
-  if (flags & SATIP_SETUP_PIDS0) {
-    strcat(buf, "&pids=0");
-    if (flags & SATIP_SETUP_PIDS21)
-      strcat(buf, ",21");
-  } else if (flags & SATIP_SETUP_PIDS21)
-    strcat(buf, "&pids=21");
-  tvhtrace(LS_SATIP, "setup params - %s", buf);
+  strcat(buf, "&pids=0");
+  if (flags & SATIP_SETUP_PIDS21)
+    strcat(buf, ",21");
+  tvhtrace(LS_SATIP, "%04X: SETUP params - %s", hc->hc_id, buf);
   if (hc->hc_rtsp_stream_id >= 0)
     snprintf(stream = _stream, sizeof(_stream), "/stream=%li",
              hc->hc_rtsp_stream_id);
@@ -309,6 +306,7 @@ satip_rtsp_play( http_client_t *hc, const char *pids,
     snprintf(stream = _stream, sizeof(_stream), "/stream=%li",
              hc->hc_rtsp_stream_id);
   query = htsbuf_to_string(&q);
+  tvhtrace(LS_SATIP, "%04X: PLAY params - %s", hc->hc_id, query);
   r = rtsp_play(hc, stream, query);
   free(query);
   if (r >= 0 && split) {