mpegts service: Add 'Service IDs as Channel Numbers' network option

This commit is contained in:
Jaroslav Kysela 2015-01-18 20:21:33 +01:00
parent 7006b9fd88
commit ac92591ba1
3 changed files with 16 additions and 7 deletions

View file

@ -298,6 +298,7 @@ struct mpegts_network
char *mn_charset;
int mn_idlescan;
int mn_ignore_chnum;
int mn_sid_chnum;
int mn_localtime;
};

View file

@ -174,6 +174,13 @@ const idclass_t mpegts_network_class =
.notify = mpegts_network_class_idlescan_notify,
.opts = PO_ADVANCED | PO_HIDDEN,
},
{
.type = PT_BOOL,
.id = "sid_chnum",
.name = "Service IDs as Channel Numbers",
.off = offsetof(mpegts_network_t, mn_ignore_chnum),
.def.i = 0,
},
{
.type = PT_BOOL,
.id = "ignore_chnum",

View file

@ -409,14 +409,15 @@ static int64_t
mpegts_service_channel_number ( service_t *s )
{
mpegts_service_t *ms = (mpegts_service_t*)s;
int r;
int r = 0;
if (ms->s_dvb_mux->mm_network->mn_ignore_chnum)
return 0;
r = ms->s_dvb_channel_num * CHANNEL_SPLIT + ms->s_dvb_channel_minor;
if (r <= 0)
r = ms->s_dvb_opentv_chnum * CHANNEL_SPLIT;
if (!ms->s_dvb_mux->mm_network->mn_ignore_chnum) {
r = ms->s_dvb_channel_num * CHANNEL_SPLIT + ms->s_dvb_channel_minor;
if (r <= 0)
r = ms->s_dvb_opentv_chnum * CHANNEL_SPLIT;
}
if (r <= 0 || ms->s_dvb_mux->mm_network->mn_sid_chnum)
r = ms->s_dvb_service_id * CHANNEL_SPLIT;
return r;
}