Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
psip: look up channel by ETT source ID
  • Loading branch information
laurimyllari authored and perexg committed Oct 22, 2015
1 parent c294b63 commit 68c6375
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/epggrab/module/psip.c
Expand Up @@ -146,6 +146,8 @@ _psip_ett_callback
int sect, last, ver;
uint16_t tsid;
uint32_t extraid, sourceid, eventid;
mpegts_mux_t *mm = mt->mt_mux;
mpegts_service_t *svc;
mpegts_table_state_t *st;

/* Validate */
Expand All @@ -162,10 +164,21 @@ _psip_ett_callback

sourceid = ptr[6] << 8 | ptr[7];
eventid = ptr[8] << 8 | ptr[9];

/* Look up channel based on the source id */
LIST_FOREACH(svc, &mm->mm_services, s_dvb_mux_link) {
if (svc->s_atsc_source_id == sourceid)
break;
}
if (!svc) {
tvhwarn("psip", "ETT with no associated channel found (sourceid 0x%04x)", sourceid);
return -1;
}

if (eventid == 0) {
tvhdebug("psip", "0x%04x: channel ETT tsid 0x%04X (%d), sourceid 0x%04X, ver %d", mt->mt_pid, tsid, tsid, sourceid, ver);
tvhdebug("psip", "0x%04x: channel ETT tableid 0x%04X [%s], ver %d", mt->mt_pid, tsid, svc->s_dvb_svcname, ver);
} else {
tvhdebug("psip", "0x%04x: ETT tsid 0x%04X (%d), sourceid 0x%04X, eventid 0x%04X, ver %d", mt->mt_pid, tsid, tsid, sourceid, eventid, ver);
tvhdebug("psip", "0x%04x: ETT tableid 0x%04X [%s], eventid 0x%04X, ver %d", mt->mt_pid, tsid, svc->s_dvb_svcname, eventid, ver);
}

return dvb_table_end(mt, st, sect);
Expand Down

0 comments on commit 68c6375

Please sign in to comment.