mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:26:14 +00:00
multiqueue: Don't access the query after signalling the waiting thread
It might've free'd the query already.
This commit is contained in:
parent
3b44a44a01
commit
1c6341e6a4
1 changed files with 4 additions and 1 deletions
|
@ -185,6 +185,8 @@ struct _GstMultiQueueItem
|
||||||
|
|
||||||
GDestroyNotify destroy;
|
GDestroyNotify destroy;
|
||||||
guint32 posid;
|
guint32 posid;
|
||||||
|
|
||||||
|
gboolean is_query;
|
||||||
};
|
};
|
||||||
|
|
||||||
static GstSingleQueue *gst_single_queue_new (GstMultiQueue * mqueue, guint id);
|
static GstSingleQueue *gst_single_queue_new (GstMultiQueue * mqueue, guint id);
|
||||||
|
@ -1110,7 +1112,7 @@ gst_multi_queue_item_steal_object (GstMultiQueueItem * item)
|
||||||
static void
|
static void
|
||||||
gst_multi_queue_item_destroy (GstMultiQueueItem * item)
|
gst_multi_queue_item_destroy (GstMultiQueueItem * item)
|
||||||
{
|
{
|
||||||
if (item->object && !GST_IS_QUERY (item->object))
|
if (!item->is_query && item->object)
|
||||||
gst_mini_object_unref (item->object);
|
gst_mini_object_unref (item->object);
|
||||||
g_slice_free (GstMultiQueueItem, item);
|
g_slice_free (GstMultiQueueItem, item);
|
||||||
}
|
}
|
||||||
|
@ -1125,6 +1127,7 @@ gst_multi_queue_buffer_item_new (GstMiniObject * object, guint32 curid)
|
||||||
item->object = object;
|
item->object = object;
|
||||||
item->destroy = (GDestroyNotify) gst_multi_queue_item_destroy;
|
item->destroy = (GDestroyNotify) gst_multi_queue_item_destroy;
|
||||||
item->posid = curid;
|
item->posid = curid;
|
||||||
|
item->is_query = GST_IS_QUERY (object);
|
||||||
|
|
||||||
item->size = gst_buffer_get_size (GST_BUFFER_CAST (object));
|
item->size = gst_buffer_get_size (GST_BUFFER_CAST (object));
|
||||||
item->duration = GST_BUFFER_DURATION (object);
|
item->duration = GST_BUFFER_DURATION (object);
|
||||||
|
|
Loading…
Reference in a new issue