From: TheTroll Date: Tue, 14 Jun 2016 18:20:54 +0000 (+0200) Subject: satip client: new muxconf option to allow partial match for muxes X-Git-Tag: v4.2.1~426 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f9aa30d0a54e1351db6101f0f3c3d4663309a3d;p=thirdparty%2Ftvheadend.git satip client: new muxconf option to allow partial match for muxes --- diff --git a/docs/property/satip_muxhandling.md b/docs/property/satip_muxhandling.md index e29f9639d..d60dc9086 100644 --- a/docs/property/satip_muxhandling.md +++ b/docs/property/satip_muxhandling.md @@ -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. diff --git a/src/input/mpegts/mpegts_dvb.h b/src/input/mpegts/mpegts_dvb.h index c0f446502..608dc5250 100644 --- a/src/input/mpegts/mpegts_dvb.h +++ b/src/input/mpegts/mpegts_dvb.h @@ -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); diff --git a/src/input/mpegts/mpegts_network_dvb.c b/src/input/mpegts/mpegts_network_dvb.c index 4790da710..f42c750d2 100644 --- a/src/input/mpegts/mpegts_network_dvb.c +++ b/src/input/mpegts/mpegts_network_dvb.c @@ -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; diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 602d39d37..de34e4aa5 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -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) diff --git a/src/satip/server.c b/src/satip/server.c index 946b6d5ff..b8fa4e203 100644 --- a/src/satip/server.c +++ b/src/satip/server.c @@ -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); } diff --git a/src/satip/server.h b/src/satip/server.h index dff09deac..3955156ee 100644 --- a/src/satip/server.h +++ b/src/satip/server.h @@ -29,9 +29,10 @@ #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