rtsp-media: Sink pipeline in gst_rtsp_media_take_pipeline()

It's taken ownership of by the media, and returned with `transfer none`
from the GstRTSPMedia::create_pipeline() vfunc. If we don't sink it
first then any bindings will wrongly take ownership of the pipeline once
it arrives in bindings code.
This commit is contained in:
Sebastian Dröge 2020-02-22 00:41:32 +02:00
parent c1ca88cd34
commit a2ba3639a5

View file

@ -956,7 +956,7 @@ gst_rtsp_media_get_element (GstRTSPMedia * media)
/**
* gst_rtsp_media_take_pipeline:
* @media: a #GstRTSPMedia
* @pipeline: (transfer full): a #GstPipeline
* @pipeline: (transfer floating): a #GstPipeline
*
* Set @pipeline as the #GstPipeline for @media. Ownership is
* taken of @pipeline.
@ -976,7 +976,7 @@ gst_rtsp_media_take_pipeline (GstRTSPMedia * media, GstPipeline * pipeline)
g_mutex_lock (&priv->lock);
old = priv->pipeline;
priv->pipeline = GST_ELEMENT_CAST (pipeline);
priv->pipeline = gst_object_ref_sink (GST_ELEMENT_CAST (pipeline));
nettime = priv->nettime;
priv->nettime = NULL;
g_mutex_unlock (&priv->lock);