]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Never delete streams when reading from raw ts file input
authorAndreas Öman <andreas@lonelycoder.com>
Mon, 3 Aug 2009 19:53:30 +0000 (19:53 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Mon, 3 Aug 2009 19:53:30 +0000 (19:53 +0000)
src/dvb/dvb_tables.c
src/psi.c
src/psi.h
src/rawtsinput.c

index 2364b7c6579c366ea1607e66f370318edf0850b4..fdd348e0b2db2a0a7a8577bf18a062d732760002 100644 (file)
@@ -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;
 }
index 6320fb8d04d7e45c4e4f27e08068c181e36e4e21..b6a05d57c696816a7bbe6243d385ee168d444f1b 100644 (file)
--- 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];
index ebf4984a641c640c8d79e33c35cc429b5f618809..f0e48aa06d633b10c35c7917a3662d6500883244 100644 (file)
--- 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);
 
index 4b2fbb00d08b565e7f330f670705c0fc57736ed2..c91ffbd623fa2282b87357d586ab3e50f63ad2d0 100644 (file)
@@ -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);
 }