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
This commit is contained in:
Sebastian Dröge 2016-03-18 13:35:37 +02:00
parent 10a9b78d40
commit cc1feff99f

View file

@ -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);