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.
This commit is contained in:
Thiago Santos 2013-08-13 12:41:28 -03:00
parent 2db211e243
commit 1b1332cb6d

View file

@ -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);
}