basesrc: Hold object lock while updating latency
authorOlivier Crête <olivier.crete@collabora.com>
Mon, 22 May 2017 22:51:12 +0000 (00:51 +0200)
committerOlivier Crête <olivier.crete@collabora.com>
Mon, 22 May 2017 22:51:49 +0000 (00:51 +0200)
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

index 1e50db2..d42ae06 100644 (file)
@@ -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);