]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip client: new muxconf option to allow partial match for muxes
authorTheTroll <trolldev@gmail.com>
Tue, 14 Jun 2016 18:20:54 +0000 (20:20 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 14 Jun 2016 18:38:05 +0000 (20:38 +0200)
docs/property/satip_muxhandling.md
src/input/mpegts/mpegts_dvb.h
src/input/mpegts/mpegts_network_dvb.c
src/satip/rtsp.c
src/satip/server.c
src/satip/server.h

index e29f9639d68f8571a2b7ccba1fb704f65e033f67..d60dc90860a2468748c538b80f37eaef315ff0db 100644 (file)
@@ -1,7 +1,8 @@
 :
 
-Option           | Description
------------------|------------
-**Auto**         | Keep the mux if it doesn't already exist.
-**Keep**         | Always keep the mux regardless of whether it exists or not.
-**Reject**       | Always reject.
+Option                  | Description
+------------------------|------------------------------------------
+**Auto**                | Keep the mux if it doesn't already exist.
+**Keep**                | Always keep the mux regardless of whether it exists or not.
+**Reject**              | Always reject.
+**Reject exact match**  | Always reject but allow partial match.  
index c0f446502678867848d8a38a895e5fd00da6d614..608dc5250551464aa3e45e1e06b1d649686c34fb 100644 (file)
@@ -70,7 +70,7 @@ dvb_network_t *dvb_network_create0
   ( const char *uuid, const idclass_t *idc, htsmsg_t *conf );
 
 dvb_mux_t *dvb_network_find_mux
-  ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid, int check );
+  ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid, int check, int approx_match );
 
 const idclass_t *dvb_network_mux_class(mpegts_network_t *mn);
 int dvb_network_get_orbital_pos(mpegts_network_t *mn);
index 4790da7102ceb95b2a1ce6c921771db8cbdda4ba..f42c750d24f5049d0b5d2be7f527c2d1141603c3 100644 (file)
@@ -80,7 +80,7 @@ dvb_network_scanfile_set ( dvb_network_t *ln, const char *id )
 
   /* Create */
   LIST_FOREACH(dmc, &sfn->sfn_muxes, dmc_link) {
-    if (!(mm = dvb_network_find_mux(ln, dmc, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, 0))) {
+    if (!(mm = dvb_network_find_mux(ln, dmc, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, 0, 0))) {
       mm = dvb_mux_create0(ln, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE,
                            dmc, NULL, NULL);
       if (mm)
@@ -498,7 +498,7 @@ dvb_network_check_orbital_pos ( int satpos1, int satpos2 )
 
 dvb_mux_t *
 dvb_network_find_mux
-  ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid, int check )
+  ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid, int check, int approx_match )
 {
   int deltaf, deltar;
   mpegts_mux_t *mm, *mm_alt = NULL;
@@ -515,7 +515,7 @@ dvb_network_find_mux
     if (lm->lm_tuning.dmc_fe_type != dmc->dmc_fe_type) continue;
 
     /* Also, the system type should match (DVB-S/DVB-S2) */
-    if (lm->lm_tuning.dmc_fe_delsys != dmc->dmc_fe_delsys) continue;
+    if (!approx_match && (lm->lm_tuning.dmc_fe_delsys != dmc->dmc_fe_delsys)) continue;
 
     /* if ONID/TSID are a perfect match (and this is DVB-S, allow greater deltaf) */
     if (lm->lm_tuning.dmc_fe_type == DVB_TYPE_S) {
@@ -540,7 +540,7 @@ dvb_network_find_mux
     if (dvb_network_check_symbol_rate(lm, dmc, deltar)) continue;
 
     /* DVB-S extra checks */
-    if (lm->lm_tuning.dmc_fe_type == DVB_TYPE_S) {
+    if (!approx_match && (lm->lm_tuning.dmc_fe_type == DVB_TYPE_S)) {
 
       /* Same modulation */
       if (!dvb_modulation_is_none_or_auto(lm->lm_tuning.dmc_fe_modulation) &&
@@ -663,7 +663,7 @@ dvb_network_create_mux
   }
 
   ln = (dvb_network_t*)mn;
-  mm = dvb_network_find_mux(ln, dmc, onid, tsid, 0);
+  mm = dvb_network_find_mux(ln, dmc, onid, tsid, 0, 0);
   if (!mm && (ln->mn_autodiscovery != MN_DISCOVERY_DISABLE || force)) {
     cls = dvb_network_mux_class((mpegts_network_t *)ln);
     save |= cls == &dvb_mux_dvbt_class && dmc->dmc_fe_type == DVB_TYPE_T;
index 602d39d376b9ce994cf6d2cef47b9996edb88c6a..de34e4aa5afbd33069feae2ad30923ade1d24a02 100644 (file)
@@ -521,7 +521,7 @@ rtsp_start
           if (!mn2) mn2 = mn;
           mux = (mpegts_mux_t *)
                 dvb_network_find_mux((dvb_network_t *)mn, &rs->dmc,
-                                     MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, 1);
+                                     MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, 1, rtsp_muxcnf == MUXCNF_REJECT_EXACT_MATCH );
           if (mux) {
             dmc = ((dvb_mux_t *)mux)->lm_tuning;
             rs->perm_lock = 0;
@@ -560,7 +560,7 @@ rtsp_start
       dvb_mux_conf_str(&rs->dmc, buf, sizeof(buf));
       tvhwarn("satips", "%i/%s/%i: unable to create mux %s%s",
               rs->frontend, rs->session, rs->stream, buf,
-              rtsp_muxcnf == MUXCNF_REJECT ? " (configuration)" : "");
+              (rtsp_muxcnf == MUXCNF_REJECT || rtsp_muxcnf == MUXCNF_REJECT_EXACT_MATCH ) ? " (configuration)" : "");
       goto endclean;
     }
     if (rs->mux == mux && rs->subs)
index 946b6d5ff728c0792533683ae688662325799a53..b8fa4e2034ba3a3866a9098e66831ca6c6827a6a 100644 (file)
@@ -559,9 +559,10 @@ static void satip_server_class_changed(idnode_t *self)
 static htsmsg_t *satip_server_class_muxcfg_list ( void *o, const char *lang )
 {
   static const struct strtab tab[] = {
-    { N_("Auto"),        MUXCNF_AUTO },
-    { N_("Keep"),        MUXCNF_KEEP },
-    { N_("Reject"),      MUXCNF_REJECT }
+    { N_("Auto"),               MUXCNF_AUTO },
+    { N_("Keep"),               MUXCNF_KEEP },
+    { N_("Reject"),             MUXCNF_REJECT },
+    { N_("Reject exact match"), MUXCNF_REJECT_EXACT_MATCH }
   };
   return strtab2htsmsg(tab, 1, lang);
 }
index dff09deacb01bef354d0c3787ab2160ca202bdef..3955156eea8bb11256a386928a847621b79d6f51 100644 (file)
 #include "udp.h"
 #include "http.h"
 
-#define MUXCNF_AUTO   0
-#define MUXCNF_KEEP   1
-#define MUXCNF_REJECT 2
+#define MUXCNF_AUTO               0
+#define MUXCNF_KEEP               1
+#define MUXCNF_REJECT             2
+#define MUXCNF_REJECT_EXACT_MATCH 3
 
 #define RTSP_TCP_DATA 1000000