Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts network: Allow to ignore the channel numbers set by a provider
  • Loading branch information
perexg committed Oct 13, 2014
1 parent 392dec0 commit 45d00a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/input/mpegts.h
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/input/mpegts/mpegts_network.c
Expand Up @@ -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",
Expand Down
11 changes: 8 additions & 3 deletions src/input/mpegts/mpegts_service.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 45d00a3

Please sign in to comment.