csa: added back in SCT_CA processing

This is a bit of a hack really, since its now the only SI data that's
handled as an elementary stream. However I think it has to be that way
else it'll get messy.
This commit is contained in:
Adam Sutton 2013-06-17 12:54:36 +01:00
parent a686fe34d2
commit d76c1e19f0
6 changed files with 11 additions and 28 deletions

View file

@ -1005,9 +1005,6 @@ psi_parse_pmt
/* Mark all streams for deletion */
TAILQ_FOREACH(st, &t->s_components, es_link) {
if(st->es_type == SCT_PMT)
continue;
st->es_delete_me = 1;
LIST_FOREACH(c, &st->es_caids, link)

View file

@ -47,32 +47,24 @@ static void ts_remux(mpegts_service_t *t, const uint8_t *tsb);
/**
* Code for dealing with a complete section
*/
#if TODO_MOVE_THIS
static void
got_section(const uint8_t *data, size_t len, void *opaque)
got_ca_section(const uint8_t *data, size_t len, void *opaque)
{
th_descrambler_t *td;
elementary_stream_t *st = opaque;
assert(st->es_service->s_source_type == S_MPEG_TS);
mpegts_service_t *t = (mpegts_service_t*)st->es_service;
if(st->es_type == SCT_CA) {
LIST_FOREACH(td, &t->s_descramblers, td_service_link)
td->td_table(td, (service_t*)t, st, data, len);
#if TODO_FIXME
} else if(st->es_got_section != NULL) {
st->es_got_section(t, st, data, len);
#endif
}
LIST_FOREACH(td, &t->s_descramblers, td_service_link)
td->td_table(td, (service_t*)t, st, data, len);
}
#endif
/**
* Continue processing of transport stream packets
*/
static void
ts_recv_packet0(mpegts_service_t *t, elementary_stream_t *st, const uint8_t *tsb)
ts_recv_packet0
(mpegts_service_t *t, elementary_stream_t *st, const uint8_t *tsb)
{
int off, pusi, cc, error;
@ -108,15 +100,9 @@ ts_recv_packet0(mpegts_service_t *t, elementary_stream_t *st, const uint8_t *tsb
switch(st->es_type) {
case SCT_CA:
case SCT_PMT:
#if TODO_MOVE_THIS
break; // TODO: we should not receive these
if(st->es_section == NULL)
st->es_section = calloc(1, sizeof(struct psi_section));
psi_section_reassemble(st->es_section, tsb, st->es_section_docrc,
got_section, st);
#endif
st->es_section = calloc(1, sizeof(mpegts_psi_section_t));
mpegts_psi_section_reassemble(st->es_section, tsb, 1, got_ca_section, st);
break;
default:
@ -243,8 +229,7 @@ ts_recv_packet1(mpegts_service_t *t, const uint8_t *tsb, int64_t *pcrp)
avgstat_add(&t->s_rate, 188, dispatch_clock);
if((tsb[3] & 0xc0) ||
(t->s_scrambled_seen && st->es_type != SCT_CA &&
st->es_type != SCT_PMT)) {
(t->s_scrambled_seen && st->es_type != SCT_CA)) {
/**
* Lock for descrambling, but only if packet was not in error

View file

@ -150,6 +150,7 @@ service_stream_destroy(service_t *t, elementary_stream_t *es)
avgstat_flush(&es->es_cc_errors);
TAILQ_REMOVE(&t->s_components, es, es_link);
free(es->es_section);
free(es->es_nicename);
free(es);
}

View file

@ -117,6 +117,8 @@ typedef struct elementary_stream {
/* Teletext subtitle */
char es_blank; // Last subtitle was blank
/* SI section processing (horrible hack) */
void *es_section;
} elementary_stream_t;

View file

@ -505,7 +505,6 @@ static struct strtab streamtypetab[] = {
{ "TELETEXT", SCT_TELETEXT },
{ "DVBSUB", SCT_DVBSUB },
{ "CA", SCT_CA },
{ "PMT", SCT_PMT },
{ "AAC", SCT_AAC },
{ "MPEGTS", SCT_MPEGTS },
{ "TEXTSUB", SCT_TEXTSUB },

View file

@ -194,7 +194,6 @@ typedef enum {
SCT_TELETEXT,
SCT_DVBSUB,
SCT_CA,
SCT_PMT,
SCT_AAC,
SCT_MPEGTS,
SCT_TEXTSUB,