Commit bd6ec225 authored by Seungha Yang's avatar Seungha Yang Committed by Edward Hervey

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
parent 4fcbcf4e
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment