summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <sh.yang@lge.com>2016-12-03 21:50:47 +0900
committerEdward Hervey <bilboed@bilboed.com>2016-12-08 16:59:07 +0100
commitbd6ec225b992340bb7535ec65726c565a0a137a1 (patch)
tree16a65bfcda093216fbd09f6f68bf61af0c6d38b1
parent4fcbcf4e4880717fc3cb4099fdfa634c26c5b977 (diff)
decodebin3: Cleanup no more used MultiQueueSlot
Since MultiQueueSlot cannot be removed inside of streaming thread, use gst_element_call_async() API. https://bugzilla.gnome.org/show_bug.cgi?id=773341
-rw-r--r--gst/playback/gstdecodebin3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gst/playback/gstdecodebin3.c b/gst/playback/gstdecodebin3.c
index 4ada16034..a1e9b3b28 100644
--- a/gst/playback/gstdecodebin3.c
+++ b/gst/playback/gstdecodebin3.c
@@ -502,6 +502,8 @@ static MultiQueueSlot *get_slot_for_input (GstDecodebin3 * dbin,
static void link_input_to_slot (DecodebinInputStream * input,
MultiQueueSlot * slot);
static void free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot);
+static void free_multiqueue_slot_async (GstDecodebin3 * dbin,
+ MultiQueueSlot * slot);
/* FIXME: Really make all the parser stuff a self-contained helper object */
#include "gstdecodebin3-parse.c"
@@ -1514,6 +1516,8 @@ multiqueue_src_probe (GstPad * pad, GstPadProbeInfo * info,
dbin->output_streams = g_list_remove (dbin->output_streams, output);
free_output_stream (dbin, output);
}
+ dbin->slots = g_list_remove (dbin->slots, slot);
+ free_multiqueue_slot_async (dbin, slot);
SELECTION_UNLOCK (dbin);
ret = GST_PAD_PROBE_HANDLED;
}
@@ -1532,6 +1536,8 @@ multiqueue_src_probe (GstPad * pad, GstPadProbeInfo * info,
g_list_remove (dbin->output_streams, output);
free_output_stream (dbin, output);
}
+ dbin->slots = g_list_remove (dbin->slots, slot);
+ free_multiqueue_slot_async (dbin, slot);
}
SELECTION_UNLOCK (dbin);
ret = GST_PAD_PROBE_DROP;
@@ -2400,6 +2406,14 @@ free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
g_free (slot);
}
+static void
+free_multiqueue_slot_async (GstDecodebin3 * dbin, MultiQueueSlot * slot)
+{
+ GST_LOG_OBJECT (dbin, "pushing multiqueue slot on thread pool to free");
+ gst_element_call_async (GST_ELEMENT_CAST (dbin),
+ (GstElementCallAsyncFunc) free_multiqueue_slot, slot, NULL);
+}
+
/* Create a DecodebinOutputStream for a given type
* Note: It will be empty initially, it needs to be configured
* afterwards */