From ff1e88ce93270a93c4ca8f688a88c733a24b62fd Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 19 Dec 2013 14:30:13 -0300 Subject: [PATCH] mssdemux: do not push event holding object lock Can lead to deadlocks as the push might block downstream in serialized event cases. --- ext/smoothstreaming/gstmssdemux.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c index 9eedf3f0c2..5a73989b6e 100644 --- a/ext/smoothstreaming/gstmssdemux.c +++ b/ext/smoothstreaming/gstmssdemux.c @@ -1180,7 +1180,7 @@ gst_mss_demux_download_loop (GstMssDemuxStream * stream) case GST_FLOW_EOS: GST_DEBUG_OBJECT (stream->pad, "EOS, stopping download loop"); - gst_mss_demux_stream_push_event (stream, gst_event_new_eos ()); + /* we push the EOS after releasing the object lock */ gst_task_pause (stream->download_task); break; @@ -1224,6 +1224,10 @@ gst_mss_demux_download_loop (GstMssDemuxStream * stream) } GST_OBJECT_UNLOCK (mssdemux); + if (G_UNLIKELY (ret == GST_FLOW_EOS)) { + gst_mss_demux_stream_push_event (stream, gst_event_new_eos ()); + } + if (buffer_downloaded) { stream->download_error_count = 0; gst_mss_stream_advance_fragment (stream->manifest_stream);