Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts: store ATSC source_id to allow associating EIT
  • Loading branch information
laurimyllari authored and perexg committed Oct 22, 2015
1 parent 448f807 commit 322f935
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/input/mpegts.h
Expand Up @@ -549,6 +549,7 @@ struct mpegts_service
int s_dvb_eit_enable;
uint64_t s_dvb_opentv_chnum;
uint16_t s_dvb_opentv_id;
uint16_t s_atsc_source_id;

/*
* Link to carrying multiplex and active adapter
Expand Down
8 changes: 8 additions & 0 deletions src/input/mpegts/dvb_psi.c
Expand Up @@ -1625,6 +1625,7 @@ atsc_vct_callback
int i, r, sect, last, ver, extraid, save, dlen;
int maj, min, count;
uint16_t tsid, sid, type;
uint16_t srcid;
char chname[256];
mpegts_mux_t *mm = mt->mt_mux, *mm_orig = mm;
mpegts_network_t *mn = mm->mm_network;
Expand Down Expand Up @@ -1660,11 +1661,13 @@ atsc_vct_callback
tsid = (ptr[22]) << 8 | ptr[23];
sid = (ptr[24]) << 8 | ptr[25];
type = ptr[27] & 0x3f;
srcid = (ptr[28]) << 8 | ptr[29];
tvhdebug("vct", "tsid %04X (%d)", tsid, tsid);
tvhdebug("vct", "sid %04X (%d)", sid, sid);
tvhdebug("vct", "chname %s", chname);
tvhdebug("vct", "chnum %d.%d", maj, min);
tvhdebug("vct", "type %02X (%d)", type, type);
tvhdebug("vct", "srcid %04X (%d)", srcid, srcid);

/* Skip */
if (type > 3)
Expand All @@ -1687,6 +1690,11 @@ atsc_vct_callback
s->s_dvb_channel_minor = min;
save = 1;
}
if (s->s_atsc_source_id != srcid) {
s->s_atsc_source_id = srcid;
save = 1;
}

/* Save */
if (save)
s->s_config_save((service_t*)s);
Expand Down
7 changes: 7 additions & 0 deletions src/input/mpegts/mpegts_service.c
Expand Up @@ -137,6 +137,13 @@ const idclass_t mpegts_service_class =
.opts = PO_RDONLY,
.off = offsetof(mpegts_service_t, s_dvb_opentv_chnum),
},
{
.type = PT_U16,
.id = "srcid",
.name = "ATSC Source ID",
.opts = PO_RDONLY,
.off = offsetof(mpegts_service_t, s_atsc_source_id),
},
{
.type = PT_STR,
.id = "svcname",
Expand Down

0 comments on commit 322f935

Please sign in to comment.