summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <sh.yang@lge.com>2016-12-03 22:46:20 +0900
committerEdward Hervey <bilboed@bilboed.com>2016-12-08 16:59:07 +0100
commit582c7cef18e1ed3fab1749b7b2f0180e7f259526 (patch)
tree1bcc205ede4880a9747964cda13f545b0617a88a
parent6bd7a5602c52150ae163b62b2dbfa86cb1cce57e (diff)
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
-rw-r--r--gst/playback/gstdecodebin3-parse.c24
1 files changed, 24 insertions, 0 deletions
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)