From cc1feff99f19c62cba46e32b1110b1414cadb6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 18 Mar 2016 13:35:37 +0200 Subject: [PATCH] mxfmux: Instead of releasing request pads on stop(), clear them only Request pads are requested by applications and as such should only be released by them again. Instead of releasing them when stopping the muxer, just clear their state so that they can be used again when starting the muxer again. https://bugzilla.gnome.org/show_bug.cgi?id=763862 --- gst/mxf/mxfmux.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/gst/mxf/mxfmux.c b/gst/mxf/mxfmux.c index c614f626cd..c21a84d0c5 100644 --- a/gst/mxf/mxfmux.c +++ b/gst/mxf/mxfmux.c @@ -221,19 +221,24 @@ gst_mxf_mux_reset (GstMXFMux * mux) GList *l; GST_OBJECT_LOCK (mux); - while ((l = GST_ELEMENT_CAST (mux)->sinkpads) != NULL) { - GstPad *pad = (GstPad *) l->data; + for (l = GST_ELEMENT_CAST (mux)->sinkpads; l; l = l->next) { + GstMXFMuxPad *pad = l->data; - gst_object_ref (pad); - GST_OBJECT_UNLOCK (mux); - gst_element_release_request_pad (GST_ELEMENT_CAST (mux), pad); - gst_object_unref (pad); - GST_OBJECT_LOCK (mux); + gst_adapter_clear (pad->adapter); + g_free (pad->mapping_data); + pad->mapping_data = NULL; + + pad->pos = 0; + pad->last_timestamp = 0; + pad->descriptor = NULL; + pad->have_complete_edit_unit = FALSE; + + pad->source_package = NULL; + pad->source_track = NULL; } GST_OBJECT_UNLOCK (mux); mux->state = GST_MXF_MUX_STATE_HEADER; - mux->n_pads = 0; if (mux->metadata) { g_hash_table_destroy (mux->metadata);