From 045476781712f785016d0bd043a488069e9b1889 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 8 Aug 2005 13:17:07 +0000 Subject: [PATCH] gst/gstbin.c: Make default message forwarding from child->bus to bin->bus threadsafe and make it not emit warnings if... Original commit message from CVS: * gst/gstbin.c: (bin_bus_handler): Make default message forwarding from child->bus to bin->bus threadsafe and make it not emit warnings if the parent has no bus. --- ChangeLog | 6 ++++++ gst/gstbin.c | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 411b74c..30199db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-08-08 Ronald S. Bultje + * gst/gstbin.c: (bin_bus_handler): + Make default message forwarding from child->bus to bin->bus + threadsafe and make it not emit warnings if the parent has no bus. + +2005-08-08 Ronald S. Bultje + * gst/gstelement.c: (activate_pads): On paused->ready, set pad->caps to NULL, as is the documented behaviour in this state change. Fixes playback of series of diff --git a/gst/gstbin.c b/gst/gstbin.c index 4fa1c42..410ca5e 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -1468,11 +1468,24 @@ bin_bus_handler (GstBus * bus, GstMessage * message, GstBin * bin) gst_message_unref (message); break; } - default: + default:{ + GstBus *bus; + /* Send all other messages upward */ - GST_DEBUG_OBJECT (bin, "posting message upward"); - gst_bus_post (GST_ELEMENT (bin)->bus, message); + GST_LOCK (bin); + if (!(bus = GST_ELEMENT (bin)->bus)) { + GST_DEBUG_OBJECT (bin, "dropping message because no parent bus"); + GST_UNLOCK (bin); + } else { + gst_object_ref (bus); + GST_UNLOCK (bin); + + GST_DEBUG_OBJECT (bin, "posting message upward"); + gst_bus_post (GST_ELEMENT (bin)->bus, message); + gst_object_unref (bus); + } break; + } } return GST_BUS_DROP; -- 2.7.4