mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
splitmuxsink: Avoid deadlock on release, harder
Unlock after broadcasting and wait for the pad to be free before relocking the muxer, giving the input probe a chance to react to our broadcast. Improves the fix from https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/838. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1030>
This commit is contained in:
parent
bf9092592e
commit
fd27ee1537
1 changed files with 6 additions and 3 deletions
|
@ -3576,6 +3576,9 @@ gst_splitmux_sink_release_pad (GstElement * element, GstPad * pad)
|
||||||
/* Remove the context from our consideration */
|
/* Remove the context from our consideration */
|
||||||
splitmux->contexts = g_list_remove (splitmux->contexts, ctx);
|
splitmux->contexts = g_list_remove (splitmux->contexts, ctx);
|
||||||
|
|
||||||
|
ctx->is_releasing = TRUE;
|
||||||
|
GST_SPLITMUX_BROADCAST_INPUT (splitmux);
|
||||||
|
|
||||||
GST_SPLITMUX_UNLOCK (splitmux);
|
GST_SPLITMUX_UNLOCK (splitmux);
|
||||||
|
|
||||||
if (ctx->sink_pad_block_id) {
|
if (ctx->sink_pad_block_id) {
|
||||||
|
@ -3586,10 +3589,10 @@ gst_splitmux_sink_release_pad (GstElement * element, GstPad * pad)
|
||||||
if (ctx->src_pad_block_id)
|
if (ctx->src_pad_block_id)
|
||||||
gst_pad_remove_probe (ctx->srcpad, ctx->src_pad_block_id);
|
gst_pad_remove_probe (ctx->srcpad, ctx->src_pad_block_id);
|
||||||
|
|
||||||
|
/* Wait for the pad to be free */
|
||||||
|
GST_PAD_STREAM_LOCK (pad);
|
||||||
GST_SPLITMUX_LOCK (splitmux);
|
GST_SPLITMUX_LOCK (splitmux);
|
||||||
|
GST_PAD_STREAM_UNLOCK (pad);
|
||||||
ctx->is_releasing = TRUE;
|
|
||||||
GST_SPLITMUX_BROADCAST_INPUT (splitmux);
|
|
||||||
|
|
||||||
/* Can release the context now */
|
/* Can release the context now */
|
||||||
mq_stream_ctx_free (ctx);
|
mq_stream_ctx_free (ctx);
|
||||||
|
|
Loading…
Reference in a new issue