mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
media-factory: unref old clock when setting new clock
https://bugzilla.gnome.org/show_bug.cgi?id=796724
This commit is contained in:
parent
f304096994
commit
7f7a210b84
1 changed files with 6 additions and 3 deletions
|
@ -1380,13 +1380,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);
|
||||
}
|
||||
|
||||
|
@ -1407,6 +1408,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;
|
||||
|
|
Loading…
Reference in a new issue