From 2325d00eee8a1a5181fa40dc4c8c6fac746d2c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 23 May 2017 00:51:12 +0200 Subject: [PATCH] basesrc: Hold object lock while updating latency Otherwise in gst_base_src_query_latency(), it ended up sometimes thinking it wasn't -1 when it was actually. --- libs/gst/base/gstbasesrc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 1e50db2e9a..d42ae062a9 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -3664,7 +3664,9 @@ gst_base_src_set_playing (GstBaseSrc * basesrc, gboolean live_play) bclass->unlock_stop (basesrc); /* for live sources we restart the timestamp correction */ + GST_OBJECT_LOCK (basesrc); basesrc->priv->latency = -1; + GST_OBJECT_UNLOCK (basesrc); /* have to restart the task in case it stopped because of the unlock when * we went to PAUSED. Only do this if we operating in push mode. */ GST_OBJECT_LOCK (basesrc->srcpad);