]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
iptv: ensure startup will not block installation of PID filters
authorAdam Sutton <dev@adamsutton.me.uk>
Mon, 23 Dec 2013 23:55:57 +0000 (23:55 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 23 Dec 2013 23:55:57 +0000 (23:55 +0000)
src/input/mpegts/iptv/iptv.c

index 5cdd9ec4ffec086186e60c006d5ad3fb502db7f7..58d6d53d7dafc9a6d12526013bccaac734182e0b 100644 (file)
@@ -203,11 +203,13 @@ iptv_input_start_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi )
 
   /* Start */
   pthread_mutex_lock(&iptv_lock);
+  im->mm_active = mmi; // Note: must set here else mux_started call
+                       // will not realise we're ready to accept pid open calls
   ret            = ih->start(im, &url);
-  if (!ret) {
-    im->mm_active  = mmi;
+  if (!ret)
     im->im_handler = ih;
-  }
+  else
+    im->mm_active  = NULL;
   pthread_mutex_unlock(&iptv_lock);
 
   return ret;