adaptivedemux: Don't parse URI unnecessarily

Short-circuit parsing and recreating the playlist URI if
no HLS directives are going to be applied to it.

Fixes problems playing some streams (YouTube) that have
unneeded escaped characters in the URI and then complain
when GStreamer removes the escaping

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4335>
This commit is contained in:
Jan Schmidt 2023-04-04 23:58:36 +10:00 committed by GStreamer Marge Bot
parent 8d4916df84
commit 8ec6ef8ca4

View file

@ -358,6 +358,10 @@ static gchar *
apply_directives_to_uri (GstHLSDemuxPlaylistLoader * pl,
const gchar * playlist_uri, struct PlaylistDownloadParams *dl_params)
{
/* Short-circuit URI parsing if nothing will change */
if (dl_params->flags == 0)
return g_strdup (playlist_uri);
GstUri *uri = gst_uri_from_string (playlist_uri);
if (dl_params->flags & PLAYLIST_DOWNLOAD_FLAG_SKIP_V1) {