hlsdemux2: Place HLS delivery directives in UTF-8 order.

Use new GstURI gst_uri_to_string_with_keys() API to produce the playlist URI
with query arguments in UTF-8 order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
Jan Schmidt 2022-11-26 03:01:14 +11:00 committed by GStreamer Marge Bot
parent 21cb739830
commit 1cede1d0cf

View file

@ -1262,7 +1262,15 @@ apply_directives_to_uri (GstHLSDemuxStream * stream,
}
}
gchar *out_uri = gst_uri_to_string (uri);
/* Produce the resulting URI with query arguments in UTF-8 order
* as required by the HLS spec:
* `Clients using Delivery Directives (Section 6.2.5) MUST ensure that
* all query parameters appear in UTF-8 order within the URI.`
*/
GList *keys = gst_uri_get_query_keys (uri);
if (keys)
keys = g_list_sort (keys, (GCompareFunc) g_strcmp0);
gchar *out_uri = gst_uri_to_string_with_keys (uri, keys);
gst_uri_unref (uri);
return out_uri;