pipeline: Remove urisink from timeline instead of unrefing it

Doing what was suggested in the FIXME and avoiding to unref
something it while we do not actually own it ourself.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>
This commit is contained in:
Thibault Saunier 2020-07-03 17:01:18 -04:00
parent 0b05bb6587
commit cc490854b5

View file

@ -1140,11 +1140,13 @@ ges_pipeline_set_render_settings (GESPipeline * pipeline,
}
/* Clear previous URI sink if it existed */
/* FIXME : We should figure out if it was added to the pipeline,
* and if so, remove it. */
if (pipeline->priv->urisink) {
gst_object_unref (pipeline->priv->urisink);
GstObject *sink_parent =
gst_object_get_parent (GST_OBJECT (pipeline->priv->urisink));
if (sink_parent == GST_OBJECT (pipeline))
gst_bin_remove (GST_BIN (pipeline), pipeline->priv->urisink);
pipeline->priv->urisink = NULL;
gst_clear_object (&sink_parent);
}
pipeline->priv->urisink =
@ -1171,7 +1173,7 @@ ges_pipeline_set_render_settings (GESPipeline * pipeline,
return FALSE;
}
/* We got a referencer when getting back the profile */
/* We got a reference when getting back the profile */
pipeline->priv->profile = profile;
return TRUE;