opentv: Add the local channel number mapping

This commit is contained in:
Jaroslav Kysela 2014-08-19 15:38:11 +02:00
parent 2f9ab1bc14
commit e6d2f393fa
3 changed files with 14 additions and 1 deletions

View file

@ -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);

View file

@ -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

View file

@ -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",
@ -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 *