mpegts network: Allow to ignore the channel numbers set by a provider

This commit is contained in:
Jaroslav Kysela 2014-10-13 20:15:40 +02:00
parent 392dec0b1d
commit 45d00a3dd1
3 changed files with 16 additions and 3 deletions

View file

@ -291,6 +291,7 @@ struct mpegts_network
int mn_skipinitscan;
char *mn_charset;
int mn_idlescan;
int mn_ignore_chnum;
};
typedef enum mpegts_mux_scan_state

View file

@ -149,6 +149,13 @@ const idclass_t mpegts_network_class =
.def.i = 0,
.notify = mpegts_network_class_idlescan_notify,
},
{
.type = PT_BOOL,
.id = "ignore_chnum",
.name = "Ignore Provider's Channel Numbers",
.off = offsetof(mpegts_network_t, mn_ignore_chnum),
.def.i = 0,
},
{
.type = PT_STR,
.id = "charset",

View file

@ -376,10 +376,15 @@ mpegts_service_grace_period(service_t *t)
static int64_t
mpegts_service_channel_number ( service_t *s )
{
int r = ((mpegts_service_t*)s)->s_dvb_channel_num * CHANNEL_SPLIT +
((mpegts_service_t*)s)->s_dvb_channel_minor;
mpegts_service_t *ms = (mpegts_service_t*)s;
int r;
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 = ((mpegts_service_t*)s)->s_dvb_opentv_chnum * CHANNEL_SPLIT;
r = ms->s_dvb_opentv_chnum * CHANNEL_SPLIT;
return r;
}