mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
bus: Check if pending messages are in the queue
We can't rely completely on the poll fd because the fd might be created after messages were posted to the bus.
This commit is contained in:
parent
ec0de993c6
commit
bd1c400114
1 changed files with 5 additions and 2 deletions
|
@ -694,8 +694,10 @@ typedef struct
|
|||
static gboolean
|
||||
gst_bus_source_prepare (GSource * source, gint * timeout)
|
||||
{
|
||||
GstBusSource *bsrc = (GstBusSource *) source;
|
||||
*timeout = -1;
|
||||
return FALSE;
|
||||
|
||||
return gst_bus_have_pending (bsrc->bus);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -703,7 +705,8 @@ gst_bus_source_check (GSource * source)
|
|||
{
|
||||
GstBusSource *bsrc = (GstBusSource *) source;
|
||||
|
||||
return bsrc->bus->priv->pollfd.revents & (G_IO_IN | G_IO_HUP | G_IO_ERR);
|
||||
return gst_bus_have_pending (bsrc->bus) | (bsrc->bus->priv->
|
||||
pollfd.revents & (G_IO_IN | G_IO_HUP | G_IO_ERR));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue