mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
bus: Immediately drop messages after calling the sync handler if this is a synchronous bus
Otherwise we might wait forever for the message to be popped from the queue if a sync handler returned GST_BUS_ASYNC. https://bugzilla.gnome.org/show_bug.cgi?id=647005
This commit is contained in:
parent
c41b0ade28
commit
80eb160e0f
1 changed files with 7 additions and 4 deletions
11
gst/gstbus.c
11
gst/gstbus.c
|
@ -347,6 +347,11 @@ gst_bus_post (GstBus * bus, GstMessage * message)
|
||||||
&& handler != gst_bus_sync_signal_handler)
|
&& handler != gst_bus_sync_signal_handler)
|
||||||
gst_bus_sync_signal_handler (bus, message, NULL);
|
gst_bus_sync_signal_handler (bus, message, NULL);
|
||||||
|
|
||||||
|
/* If this is a bus without async message delivery
|
||||||
|
* always drop the message */
|
||||||
|
if (!bus->priv->poll)
|
||||||
|
reply = GST_BUS_DROP;
|
||||||
|
|
||||||
/* now see what we should do with the message */
|
/* now see what we should do with the message */
|
||||||
switch (reply) {
|
switch (reply) {
|
||||||
case GST_BUS_DROP:
|
case GST_BUS_DROP:
|
||||||
|
@ -357,8 +362,7 @@ gst_bus_post (GstBus * bus, GstMessage * message)
|
||||||
/* pass the message to the async queue, refcount passed in the queue */
|
/* pass the message to the async queue, refcount passed in the queue */
|
||||||
GST_DEBUG_OBJECT (bus, "[msg %p] pushing on async queue", message);
|
GST_DEBUG_OBJECT (bus, "[msg %p] pushing on async queue", message);
|
||||||
gst_atomic_queue_push (bus->queue, message);
|
gst_atomic_queue_push (bus->queue, message);
|
||||||
if (bus->priv->poll)
|
gst_poll_write_control (bus->priv->poll);
|
||||||
gst_poll_write_control (bus->priv->poll);
|
|
||||||
GST_DEBUG_OBJECT (bus, "[msg %p] pushed on async queue", message);
|
GST_DEBUG_OBJECT (bus, "[msg %p] pushed on async queue", message);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -380,8 +384,7 @@ gst_bus_post (GstBus * bus, GstMessage * message)
|
||||||
g_mutex_lock (lock);
|
g_mutex_lock (lock);
|
||||||
|
|
||||||
gst_atomic_queue_push (bus->queue, message);
|
gst_atomic_queue_push (bus->queue, message);
|
||||||
if (bus->priv->poll)
|
gst_poll_write_control (bus->priv->poll);
|
||||||
gst_poll_write_control (bus->priv->poll);
|
|
||||||
|
|
||||||
/* now block till the message is freed */
|
/* now block till the message is freed */
|
||||||
g_cond_wait (cond, lock);
|
g_cond_wait (cond, lock);
|
||||||
|
|
Loading…
Reference in a new issue