Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dvb: add DVB_NO_STREAM_ID_FILTER define
  • Loading branch information
perexg committed Feb 2, 2015
1 parent e929961 commit 18c9d1d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/input/mpegts/dvb.h
Expand Up @@ -424,6 +424,8 @@ typedef enum dvb_polarisation {
DVB_POLARISATION_OFF = 0x04
} dvb_polarisation_t;

#define DVB_NO_STREAM_ID_FILTER (-1)

typedef struct dvb_qpsk_config {
dvb_polarisation_t polarisation;
int orbital_pos;
Expand Down
9 changes: 5 additions & 4 deletions src/input/mpegts/linuxdvb/linuxdvb_frontend.c
Expand Up @@ -1321,12 +1321,13 @@ linuxdvb_frontend_tune0
} else {
S2CMD(DTV_PILOT, TR(pilot, pilot_tbl, PILOT_AUTO));
S2CMD(DTV_ROLLOFF, TR(rolloff, rolloff_tbl, ROLLOFF_AUTO));
r = dmc->dmc_fe_stream_id != -1 ? (dmc->dmc_fe_stream_id & 0xFF) |
((dmc->dmc_fe_pls_code & 0x3FFFF)<<8) | ((dmc->dmc_fe_pls_mode & 0x3)<<26) : dmc->dmc_fe_stream_id;
r = dmc->dmc_fe_stream_id != DVB_NO_STREAM_ID_FILTER ? (dmc->dmc_fe_stream_id & 0xFF) |
((dmc->dmc_fe_pls_code & 0x3FFFF)<<8) | ((dmc->dmc_fe_pls_mode & 0x3)<<26) :
DVB_NO_STREAM_ID_FILTER;
#if DVB_VER_ATLEAST(5,9)
S2CMD(DTV_STREAM_ID, r );
S2CMD(DTV_STREAM_ID, r);
#elif DVB_VER_ATLEAST(5,3)
S2CMD(DTV_DVBT2_PLP_ID, r);
S2CMD(DTV_DVBT2_PLP_ID, r);
#endif
}

Expand Down
5 changes: 3 additions & 2 deletions src/input/mpegts/mpegts_mux_dvb.c
Expand Up @@ -223,7 +223,7 @@ const idclass_t dvb_mux_dvbt_class =
.id = "plp_id",
.name = "PLP ID",
.off = offsetof(dvb_mux_t, lm_tuning.dmc_fe_stream_id),
.def.i = 0,
.def.i = DVB_NO_STREAM_ID_FILTER,
},
{}
}
Expand Down Expand Up @@ -544,7 +544,7 @@ const idclass_t dvb_mux_dvbs_class =
.id = "stream_id",
.name = "ISI",
.off = offsetof(dvb_mux_t, lm_tuning.dmc_fe_stream_id),
.def.i = -1,
.def.i = DVB_NO_STREAM_ID_FILTER,
},
{
.type = PT_STR,
Expand Down Expand Up @@ -712,6 +712,7 @@ dvb_mux_create0
/* Defaults */
lm->lm_tuning.dmc_fe_inversion = DVB_INVERSION_AUTO;
lm->lm_tuning.dmc_fe_pilot = DVB_PILOT_AUTO;
lm->lm_tuning.dmc_fe_stream_id = DVB_NO_STREAM_ID_FILTER;

/* Parent init and load config */
if (!(mm = mpegts_mux_create0(mm, idc, uuid,
Expand Down
8 changes: 4 additions & 4 deletions src/input/mpegts/scanfile.c
Expand Up @@ -142,7 +142,7 @@ scanfile_load_dvbt ( dvb_mux_conf_t *mux, const char *line )
r = sscanf(line+1, "%u %10s %10s %10s %10s %10s %10s %10s %u",
&mux->dmc_fe_freq, bw, fec, fec2, qam,
mode, guard, hier, &mux->dmc_fe_stream_id);
if(r == 8) mux->dmc_fe_stream_id = -1; else
if(r == 8) mux->dmc_fe_stream_id = DVB_NO_STREAM_ID_FILTER; else
if(r != 9) return 1;
}
mux->dmc_fe_delsys = DVB_SYS_DVBT2;
Expand Down Expand Up @@ -188,7 +188,7 @@ scanfile_load_dvbs ( dvb_mux_conf_t *mux, const char *line )
mux->dmc_fe_delsys = DVB_SYS_DVBS2;
if ((mux->dmc_fe_rolloff = dvb_str2rolloff(rolloff)) == -1) return 1;
if ((mux->dmc_fe_modulation = dvb_str2qam(qam)) == -1) return 1;
if (r < (4+v2+1)) mux->dmc_fe_stream_id = -1;
if (r < (4+v2+1)) mux->dmc_fe_stream_id = DVB_NO_STREAM_ID_FILTER;
if (r < (4+v2+2)) mux->dmc_fe_pls_code = 1;
if (r < (4+v2+3)) mux->dmc_fe_pls_mode = 0;
} else {
Expand Down Expand Up @@ -458,7 +458,7 @@ scanfile_load_dvbv5 ( scanfile_network_t *net, char *line, fb_file *fp )
if ((mux->dmc_fe_inversion = dvb_str2inver(x)) == -1)
mux_fail(r, "wrong inversion '%s'", x);
if (htsmsg_get_s32(l, "STREAM_ID", &mux->dmc_fe_stream_id))
mux->dmc_fe_stream_id = -1;
mux->dmc_fe_stream_id = DVB_NO_STREAM_ID_FILTER;

} else if (mux->dmc_fe_delsys == DVB_SYS_DVBS ||
mux->dmc_fe_delsys == DVB_SYS_DVBS2) {
Expand Down Expand Up @@ -487,7 +487,7 @@ scanfile_load_dvbv5 ( scanfile_network_t *net, char *line, fb_file *fp )
if ((mux->dmc_fe_pilot = dvb_str2rolloff(x)) == -1)
mux_fail(r, "wrong pilot '%s'", x);
if (htsmsg_get_s32(l, "STREAM_ID", &r)) {
mux->dmc_fe_stream_id = -1;
mux->dmc_fe_stream_id = DVB_NO_STREAM_ID_FILTER;
mux->dmc_fe_pls_mode = 0;
mux->dmc_fe_pls_code = 1;
}
Expand Down

0 comments on commit 18c9d1d

Please sign in to comment.