diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c index 93bb81ddeb..058bda1af7 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c @@ -2170,6 +2170,8 @@ gst_adaptive_demux2_stream_is_running (GstAdaptiveDemux2Stream * stream) return TRUE; } +/* Returns TRUE if the stream has at least one selected track. + * Must be called with the TRACKS_LOCK held */ gboolean gst_adaptive_demux2_stream_is_selected_locked (GstAdaptiveDemux2Stream * stream) { diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c index e809c28825..8989dfc31b 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c @@ -2363,23 +2363,6 @@ gst_adaptive_demux_handle_seek_event (GstAdaptiveDemux * demux, return ret; } -/* Returns TRUE if the stream has at least one selected track */ -static gboolean -gst_adaptive_demux2_stream_has_selected_tracks (GstAdaptiveDemux2Stream * - stream) -{ - GList *tmp; - - for (tmp = stream->tracks; tmp; tmp = tmp->next) { - GstAdaptiveDemuxTrack *track = tmp->data; - - if (track->selected) - return TRUE; - } - - return FALSE; -} - static gboolean handle_stream_selection (GstAdaptiveDemux * demux, GList * streams, guint32 seqnum) @@ -2448,7 +2431,7 @@ handle_stream_selection (GstAdaptiveDemux * demux, GList * streams, gboolean is_running = gst_adaptive_demux2_stream_is_running (stream); gboolean should_be_running = - gst_adaptive_demux2_stream_has_selected_tracks (stream); + gst_adaptive_demux2_stream_is_selected_locked (stream); if (!is_running && should_be_running) { GstClockTime output_running_ts = demux->priv->global_output_position;