Commit de08f6d6 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

media-factory: unref old clock when setting new clock

https://bugzilla.gnome.org/show_bug.cgi?id=796724
parent 241fbd4e
......@@ -1332,13 +1332,14 @@ void
gst_rtsp_media_factory_set_clock (GstRTSPMediaFactory * factory,
GstClock * clock)
{
GstRTSPMediaFactoryPrivate *priv;
GstClock **clock_p;
g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory));
g_return_if_fail (GST_IS_CLOCK (clock) || clock == NULL);
GST_RTSP_MEDIA_FACTORY_LOCK (factory);
priv = factory->priv;
priv->clock = clock ? gst_object_ref (clock) : NULL;
clock_p = &factory->priv->clock;
gst_object_replace ((GstObject **) clock_p, (GstObject *) clock);
GST_RTSP_MEDIA_FACTORY_UNLOCK (factory);
}
......@@ -1359,6 +1360,8 @@ gst_rtsp_media_factory_get_clock (GstRTSPMediaFactory * factory)
GstRTSPMediaFactoryPrivate *priv;
GstClock *ret;
g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), NULL);
GST_RTSP_MEDIA_FACTORY_LOCK (factory);
priv = factory->priv;
ret = priv->clock ? gst_object_ref (priv->clock) : NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment