hlsdemux2: Avoid assert in _has_next_fragment()

gst_hls_demux_stream_has_next_fragment() can be called with a NULL
current_segment if we're past the end of the current playlist. In that case,
just return FALSE instead of hitting a critical in the playlist code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
Jan Schmidt 2022-11-26 02:59:48 +11:00 committed by GStreamer Marge Bot
parent 018a6192bd
commit 21cb739830

View file

@ -1096,6 +1096,9 @@ gst_hls_demux_stream_has_next_fragment (GstAdaptiveDemux2Stream * stream)
GST_DEBUG_OBJECT (stream, "has next ?");
if (hls_stream->current_segment == NULL)
return FALSE;
return gst_hls_media_playlist_has_next_fragment (hls_stream->playlist,
hls_stream->current_segment, stream->demux->segment.rate > 0);
}