splitmuxsink: do not destroy the multiqueue & muxer when going to NULL

Instead, delay it until all request pads have been released. This is
because the release_pad() vfunc requires the multiqueue and muxer to
be there in order to release their request pads as well. If those
elements are destroyed earlier, release_pad() does not work, no
pads are released and some resources are leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=753622
This commit is contained in:
George Kiagiadakis 2015-10-24 23:57:29 +02:00 committed by Jan Schmidt
parent cbf181f31b
commit 4a78048cc5

View file

@ -1321,6 +1321,10 @@ gst_splitmux_sink_release_pad (GstElement * element, GstPad * pad)
gst_element_remove_pad (element, pad);
/* Reset the internal elements only after all request pads are released */
if (splitmux->contexts == NULL)
gst_splitmux_reset (splitmux);
fail:
GST_SPLITMUX_UNLOCK (splitmux);
}
@ -1554,7 +1558,9 @@ gst_splitmux_sink_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_READY_TO_NULL:
GST_SPLITMUX_LOCK (splitmux);
splitmux->fragment_id = 0;
gst_splitmux_reset (splitmux);
/* Reset internal elements only if no pad contexts are using them */
if (splitmux->contexts == NULL)
gst_splitmux_reset (splitmux);
GST_SPLITMUX_UNLOCK (splitmux);
break;
default: