+/**
+ * gst_bus_remove_watch:
+ * @bus: a #GstBus to remove the watch from.
+ *
+ * Removes an installed bus watch from @bus.
+ *
+ * Returns: %TRUE on success or %FALSE if @bus has no event source.
+ *
+ * Since: 1.6
+ *
+ */
+gboolean
+gst_bus_remove_watch (GstBus * bus)
+{
+ GSource *source;
+
+ g_return_val_if_fail (GST_IS_BUS (bus), FALSE);
+
+ GST_OBJECT_LOCK (bus);
+
+ if (bus->priv->signal_watch == NULL) {
+ GST_ERROR_OBJECT (bus, "no bus watch was present");
+ goto error;
+ }
+
+ if (bus->priv->num_signal_watchers > 0) {
+ GST_ERROR_OBJECT (bus,
+ "trying to remove signal watch with gst_bus_remove_watch()");
+ goto error;
+ }
+
+ source =
+ bus->priv->signal_watch ? g_source_ref (bus->priv->signal_watch) : NULL;
+
+ GST_OBJECT_UNLOCK (bus);
+
+ if (source) {
+ g_source_destroy (source);
+ g_source_unref (source);
+ }
+
+ return TRUE;
+
+error:
+ GST_OBJECT_UNLOCK (bus);
+
+ return FALSE;
+}
+