adaptivedemux: make sure to free all "old streams"
authorMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Wed, 31 May 2017 01:14:04 +0000 (03:14 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 12 Jun 2017 14:09:47 +0000 (16:09 +0200)
As we release the MANIFEST_LOCK in stop_tasks,
demux->priv->old_streams can be set, we need to free these
otherwise we may end up trying to dispose elements in the
READY state.

https://bugzilla.gnome.org/show_bug.cgi?id=783256

gst-libs/gst/adaptivedemux/gstadaptivedemux.c

index 3843b1f..edbf55e 100644 (file)
@@ -809,6 +809,12 @@ gst_adaptive_demux_reset (GstAdaptiveDemux * demux)
         (GDestroyNotify) gst_adaptive_demux_stream_free);
   }
 
+  if (demux->priv->old_streams) {
+    g_list_free_full (demux->priv->old_streams,
+        (GDestroyNotify) gst_adaptive_demux_stream_free);
+    demux->priv->old_streams = NULL;
+  }
+
   g_free (demux->manifest_uri);
   g_free (demux->manifest_base_uri);
   demux->manifest_uri = NULL;