]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mpegts: remove assigned mux instances when the input adapter is deleted
authorJaroslav Kysela <perex@perex.cz>
Mon, 19 May 2014 07:33:00 +0000 (09:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 19 May 2014 07:52:37 +0000 (09:52 +0200)
src/input/mpegts/mpegts_input.c

index f28264115eac7e3dae397e1083f372f7b2f49a98..10e093c656fa4f5d9c53e7e8ba42765283051228 100644 (file)
@@ -955,11 +955,21 @@ void
 mpegts_input_delete ( mpegts_input_t *mi, int delconf )
 {
   mpegts_network_link_t *mnl;
+  mpegts_mux_instance_t *mmi, *mmi_next;
 
   /* Remove networks */
   while ((mnl = LIST_FIRST(&mi->mi_networks)))
     mpegts_input_del_network(mnl);
 
+  /* Remove mux instances assigned to this input */
+  mmi = LIST_FIRST(&mi->mi_mux_instances);
+  while (mmi) {
+    mmi_next = LIST_NEXT(mmi, mmi_input_link);
+    if (mmi->mmi_input == mi)
+      mmi->mmi_delete(mmi);
+    mmi = mmi_next;
+  }
+
   /* Remove global refs */
   idnode_unlink(&mi->ti_id);
   LIST_REMOVE(mi, ti_link);