adaptivedemux2: Hold tracks lock accessing input_period

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>
This commit is contained in:
Jan Schmidt 2022-10-11 03:20:11 +11:00
parent 93f80bb061
commit b691aece65

View 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;
}