adaptivedemux2: Hold tracks lock accessing input_period
authorJan Schmidt <jan@centricular.com>
Mon, 10 Oct 2022 16:20:11 +0000 (03:20 +1100)
committerJan Schmidt <jan@centricular.com>
Fri, 4 Nov 2022 16:24:26 +0000 (03:24 +1100)
The input_period is protected by the TRACKS_LOCK,
so make sure to hold that when accessing it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>

subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c

index f4ff4d5..f154aee 100644 (file)
@@ -2942,6 +2942,9 @@ gst_adaptive_demux_stop_tasks (GstAdaptiveDemux * demux, gboolean stop_updates)
     gst_adaptive_demux_stop_manifest_update_task (demux);
 
   TRACKS_LOCK (demux);
+  if (demux->input_period)
+    gst_adaptive_demux_period_stop_tasks (demux->input_period);
+
   demux->priv->flushing = TRUE;
   g_cond_signal (&demux->priv->tracks_add);
   gst_task_stop (demux->priv->output_task);
@@ -2949,9 +2952,6 @@ gst_adaptive_demux_stop_tasks (GstAdaptiveDemux * demux, gboolean stop_updates)
 
   gst_task_join (demux->priv->output_task);
 
-  if (demux->input_period)
-    gst_adaptive_demux_period_stop_tasks (demux->input_period);
-
   demux->priv->qos_earliest_time = GST_CLOCK_TIME_NONE;
 }