From e0a92a06041c32a64f21da5b0f83870872848586 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Mon, 5 May 2008 16:47:29 +0000 Subject: [PATCH] gst/gstbus.c: Don't print a warning if the queue is empty when we try to pop here. That could happen if another threa... Original commit message from CVS: Patch by: Sjoerd Simons * gst/gstbus.c: (gst_bus_source_dispatch): Don't print a warning if the queue is empty when we try to pop here. That could happen if another thread or callback set the bus to flushing between the source's check/prepare and the dispatch being called (#531538). --- ChangeLog | 10 ++++++++++ gst/gstbus.c | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 86c8f30..c17bdfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2008-05-05 Tim-Philipp Müller + Patch by: Sjoerd Simons + + * gst/gstbus.c: (gst_bus_source_dispatch): + Don't print a warning if the queue is empty when we try to pop + here. That could happen if another thread or callback set the + bus to flushing between the source's check/prepare and the + dispatch being called (#531538). + +2008-05-05 Tim-Philipp Müller + * plugins/elements/gstmultiqueue.c: Small docs fix. diff --git a/gst/gstbus.c b/gst/gstbus.c index cfffdd4..c2a9093 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -769,7 +769,11 @@ gst_bus_source_dispatch (GSource * source, GSourceFunc callback, g_return_val_if_fail (GST_IS_BUS (bus), FALSE); message = gst_bus_pop (bus); - g_return_val_if_fail (message != NULL, FALSE); + + /* The message queue might be empty if some other thread or callback set + * the bus to flushing between check/prepare and dispatch */ + if (G_UNLIKELY (message == NULL)) + return TRUE; if (!handler) goto no_handler; -- 2.7.4