From 1b1332cb6d2da4d88f7aed3c249213adf84fe2fe Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 13 Aug 2013 12:41:28 -0300 Subject: [PATCH] mssdemux: use gst_data_queue_push_force for adding events to queue This prevents locking on startup when a stream only has a single buffer for one of the streams and mssdemux decides to push an EOS event right after it. --- ext/smoothstreaming/gstmssdemux.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c index 4d3a86db8b..35a424af94 100644 --- a/ext/smoothstreaming/gstmssdemux.c +++ b/ext/smoothstreaming/gstmssdemux.c @@ -1022,6 +1022,7 @@ gst_mss_demux_stream_store_object (GstMssDemuxStream * stream, GstMiniObject * obj) { GstDataQueueItem *item; + gboolean ret = FALSE; item = g_slice_new (GstDataQueueItem); item->object = (GstMiniObject *) obj; @@ -1032,7 +1033,13 @@ gst_mss_demux_stream_store_object (GstMssDemuxStream * stream, item->destroy = (GDestroyNotify) _free_data_queue_item; - if (!gst_data_queue_push (stream->dataqueue, item)) { + if (G_LIKELY (GST_IS_BUFFER (obj))) { + ret = gst_data_queue_push (stream->dataqueue, item); + } else { + ret = gst_data_queue_push_force (stream->dataqueue, item); + } + + if (!ret) { GST_DEBUG_OBJECT (stream->parent, "Failed to store object %p", obj); item->destroy (item); }