summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9e36a51)
raw | patch | inline | side by side (parent: 9e36a51)
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | |
Mon, 21 Mar 2011 16:52:13 +0000 (17:52 +0100) | ||
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | |
Mon, 21 Mar 2011 16:52:59 +0000 (17:52 +0100) |
Before it was only protected by the stream lock but every pad
has its own stream lock, making the protection rather useless.
has its own stream lock, making the protection rather useless.
plugins/elements/gstmultiqueue.c | patch | blob | history | |
plugins/elements/gstmultiqueue.h | patch | blob | history |
index f1956dae9ebd84fdb3fb704771eb09e432cc92ce..3f1eef570507c357507d14f8502847a828cbb01f 100644 (file)
goto was_eos;
/* Get a unique incrementing id */
- curid = mq->counter++;
+ curid = g_atomic_int_exchange_and_add ((gint *) & mq->counter, 1);
GST_LOG_OBJECT (mq, "SingleQueue %d : about to enqueue buffer %p with id %d",
sq->id, buffer, curid);
if (sq->is_eos)
goto was_eos;
- /* Get an unique incrementing id. protected with the STREAM_LOCK, unserialized
- * events already got pushed and don't end up in the queue. */
- curid = mq->counter++;
+ /* Get an unique incrementing id. */
+ curid = g_atomic_int_exchange_and_add ((gint *) & mq->counter, 1);
item = gst_multi_queue_event_item_new ((GstMiniObject *) event, curid);
index ec47601d08ce67c04ec7ee21300497698a92ca28..60262b7c137ee3ded218ee49f1aef104bb096d61 100644 (file)
gboolean buffering;
gint percent;
- guint32 counter; /* incoming object counter, protected with STREAM_LOCK */
+ guint32 counter; /* incoming object counter, use atomic accesses */
guint32 highid; /* contains highest id of last outputted object */
GMutex * qlock; /* Global queue lock (vs object lock or individual */