From 582c7cef18e1ed3fab1749b7b2f0180e7f259526 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 3 Dec 2016 22:46:20 +0900 Subject: decodebin3: More cleanup DecodebinOutputStream and MultiQueueSlot When removing DecodebinInputStream, cleanup DecodebinOutputStream and MultiQueueSlot also if they were drained. https://bugzilla.gnome.org/show_bug.cgi?id=773341 --- gst/playback/gstdecodebin3-parse.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gst/playback/gstdecodebin3-parse.c b/gst/playback/gstdecodebin3-parse.c index df558f94d..deeac03be 100644 --- a/gst/playback/gstdecodebin3-parse.c +++ b/gst/playback/gstdecodebin3-parse.c @@ -567,8 +567,32 @@ parsebin_pad_removed_cb (GstElement * demux, GstPad * pad, DecodebinInput * inp) if (input) { GST_DEBUG_OBJECT (pad, "stream %p", input); if (inp->pending_pads == NULL) { + MultiQueueSlot *slot; + GST_DEBUG_OBJECT (pad, "Remove input stream %p", input); + + SELECTION_LOCK (dbin); + slot = get_slot_for_input (dbin, input); + SELECTION_UNLOCK (dbin); + remove_input_stream (dbin, input); + + SELECTION_LOCK (dbin); + if (slot && g_list_find (dbin->slots, slot) && slot->is_drained) { + /* if slot is still there and already drained, remove it in here */ + if (slot->output) { + DecodebinOutputStream *output = slot->output; + GST_DEBUG_OBJECT (pad, + "Multiqueue was drained, Remove output stream"); + + dbin->output_streams = g_list_remove (dbin->output_streams, output); + free_output_stream (dbin, output); + } + GST_DEBUG_OBJECT (pad, "No pending pad, Remove multiqueue slot"); + dbin->slots = g_list_remove (dbin->slots, slot); + free_multiqueue_slot_async (dbin, slot); + } + SELECTION_UNLOCK (dbin); } else { input->srcpad = NULL; if (input->input_buffer_probe_id) -- cgit v1.2.3