Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
satip client: new muxconf option to allow partial match for muxes
  • Loading branch information
TheTroll authored and perexg committed Jun 14, 2016
1 parent 054d542 commit 8f9aa30
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
11 changes: 6 additions & 5 deletions 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.
2 changes: 1 addition & 1 deletion src/input/mpegts/mpegts_dvb.h
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src/input/mpegts/mpegts_network_dvb.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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) &&
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/satip/rtsp.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions src/satip/server.c
Expand Up @@ -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);
}
Expand Down
7 changes: 4 additions & 3 deletions src/satip/server.h
Expand Up @@ -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

Expand Down

0 comments on commit 8f9aa30

Please sign in to comment.