mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
hlsdemux2: Cancel preload before fetching something else
When submitting a request for fragment or header that doesn't match any preload, make sure there's not an ongoing preload for that data type, to avoid parallel downloads using up bandwidth. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
parent
70bfeff35d
commit
cbb9cfe987
1 changed files with 12 additions and 0 deletions
|
@ -2374,6 +2374,18 @@ gst_hls_demux_stream_submit_request (GstAdaptiveDemux2Stream * stream,
|
|||
if (gst_hls_demux_preloader_provide_request (hlsdemux_stream->preloader,
|
||||
download_req))
|
||||
return GST_FLOW_OK;
|
||||
|
||||
/* We're about to request something, but it wasn't the active preload,
|
||||
* so make sure that's been stopped / cancelled so we're not downloading
|
||||
* two things in parallel. This usually means the playlist refresh
|
||||
* took too long and the preload became obsolete */
|
||||
if (stream->downloading_header) {
|
||||
gst_hls_demux_preloader_cancel (hlsdemux_stream->preloader,
|
||||
M3U8_PRELOAD_HINT_MAP);
|
||||
} else {
|
||||
gst_hls_demux_preloader_cancel (hlsdemux_stream->preloader,
|
||||
M3U8_PRELOAD_HINT_PART);
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue