Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
opentv: Add the local channel number mapping
  • Loading branch information
perexg committed Aug 19, 2014
1 parent 2f9ab1b commit e6d2f39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/epggrab/module/opentv.c
Expand Up @@ -400,6 +400,8 @@ opentv_desc_channels
/* Find the service */
svc = mpegts_service_find(mm, sid, 0, 0, NULL);
tvhtrace(mt->mt_name, " svc %p [%s]", svc, svc ? svc->s_nicename : NULL);
if (svc)
svc->s_dvb_opentv_chnum = cnum;
if (svc && LIST_FIRST(&svc->s_channels)) {
ec =_opentv_find_epggrab_channel(mod, cid, 1, &save);
ecl = LIST_FIRST(&ec->channels);
Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts.h
Expand Up @@ -435,6 +435,7 @@ struct mpegts_service
*/

int s_dvb_eit_enable;
uint16_t s_dvb_opentv_chnum;

/*
* Link to carrying multiplex and active adapter
Expand Down
12 changes: 11 additions & 1 deletion src/input/mpegts/mpegts_service.c
Expand Up @@ -101,6 +101,13 @@ const idclass_t mpegts_service_class =
.opts = PO_RDONLY,
.off = offsetof(mpegts_service_t, s_dvb_channel_num),
},
{
.type = PT_U16,
.id = "lcn2",
.name = "OpenTV Channel Number",
.opts = PO_RDONLY,
.off = offsetof(mpegts_service_t, s_dvb_opentv_chnum),
},
{
.type = PT_STR,
.id = "svcname",
Expand Down Expand Up @@ -360,7 +367,10 @@ mpegts_service_grace_period(service_t *t)
static int
mpegts_service_channel_number ( service_t *s )
{
return ((mpegts_service_t*)s)->s_dvb_channel_num;
int r = ((mpegts_service_t*)s)->s_dvb_channel_num;
if (r <= 0)
r = ((mpegts_service_t*)s)->s_dvb_opentv_chnum;
return r;
}

static const char *
Expand Down

0 comments on commit e6d2f39

Please sign in to comment.