From 2eba601b48c82f244aefd4be5fed44dabd1c1874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Mon, 3 Aug 2009 19:53:30 +0000 Subject: [PATCH] Never delete streams when reading from raw ts file input --- src/dvb/dvb_tables.c | 2 +- src/psi.c | 8 +++++--- src/psi.h | 3 ++- src/rawtsinput.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/dvb/dvb_tables.c b/src/dvb/dvb_tables.c index 2364b7c6..fdd348e0 100644 --- a/src/dvb/dvb_tables.c +++ b/src/dvb/dvb_tables.c @@ -1002,7 +1002,7 @@ dvb_pmt_callback(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len, th_transport_t *t = opaque; pthread_mutex_lock(&t->tht_stream_mutex); - psi_parse_pmt(t, ptr, len, 1); + psi_parse_pmt(t, ptr, len, 1, 1); pthread_mutex_unlock(&t->tht_stream_mutex); return 0; } diff --git a/src/psi.c b/src/psi.c index 6320fb8d..b6a05d57 100644 --- a/src/psi.c +++ b/src/psi.c @@ -236,7 +236,8 @@ psi_desc_ca(th_transport_t *t, uint8_t *ptr, int len) * PMT parser, from ISO 13818-1 and ETSI EN 300 468 */ int -psi_parse_pmt(th_transport_t *t, uint8_t *ptr, int len, int chksvcid) +psi_parse_pmt(th_transport_t *t, uint8_t *ptr, int len, int chksvcid, + int delete) { uint16_t pcr_pid, pid; uint8_t estype; @@ -276,8 +277,9 @@ psi_parse_pmt(th_transport_t *t, uint8_t *ptr, int len, int chksvcid) len -= 9; /* Mark all streams for deletion */ - LIST_FOREACH(st, &t->tht_components, st_link) - st->st_delete_me = 1; + if(delete) + LIST_FOREACH(st, &t->tht_components, st_link) + st->st_delete_me = 1; while(dllen > 1) { dtag = ptr[0]; diff --git a/src/psi.h b/src/psi.h index ebf4984a..f0e48aa0 100644 --- a/src/psi.h +++ b/src/psi.h @@ -35,7 +35,8 @@ int psi_section_reassemble(psi_section_t *ps, uint8_t *data, int len, int psi_parse_pat(th_transport_t *t, uint8_t *ptr, int len, pid_section_callback_t *pmt_callback); -int psi_parse_pmt(th_transport_t *t, uint8_t *ptr, int len, int chksvcid); +int psi_parse_pmt(th_transport_t *t, uint8_t *ptr, int len, int chksvcid, + int delete); uint32_t psi_crc32(uint8_t *data, size_t datalen); diff --git a/src/rawtsinput.c b/src/rawtsinput.c index 4b2fbb00..c91ffbd6 100644 --- a/src/rawtsinput.c +++ b/src/rawtsinput.c @@ -147,7 +147,7 @@ got_pmt(struct th_transport *t, th_stream_t *st, return; pthread_mutex_lock(&global_lock); - psi_parse_pmt(t, table + 3, table_len - 3, 1); + psi_parse_pmt(t, table + 3, table_len - 3, 1, 0); pthread_mutex_unlock(&global_lock); }