adaptivedemux2: Don't allow stream selection while switching periods

The stream selection is done on the currently outputting tracks, but in order to
(de)activate the backing streams we can only do it if the input and output
period are identical.

Fixes crash when doing stream selection during period migration

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3525>
This commit is contained in:
Edward Hervey 2022-12-05 10:55:57 +01:00 committed by GStreamer Marge Bot
parent df311a65da
commit 63b598b409

View file

@ -2355,6 +2355,13 @@ handle_stream_selection (GstAdaptiveDemux * demux, GList * streams,
return FALSE; return FALSE;
TRACKS_LOCK (demux); TRACKS_LOCK (demux);
/* We can't do stream selection if we are migrating between periods */
if (demux->input_period && demux->output_period != demux->input_period) {
GST_WARNING_OBJECT (demux,
"Stream selection while migrating between periods is not possible");
TRACKS_UNLOCK (demux);
return FALSE;
}
/* Validate the streams and fill: /* Validate the streams and fill:
* tracks : list of tracks corresponding to requested streams * tracks : list of tracks corresponding to requested streams
*/ */