Skip to content

Commit

Permalink
fix(HLS): Avoid variable substitution if no variables (shaka-project#…
Browse files Browse the repository at this point in the history
…5269)

With this change, we improve performance on very large playlists.
  • Loading branch information
avelad committed Jun 8, 2023
1 parent 9059944 commit 5a5a7ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/hls/hls_parser.js
Expand Up @@ -3208,6 +3208,9 @@ shaka.hls.HlsParser = class {
* @private
*/
variableSubstitution_(uri, variables) {
if (!variables.size) {
return uri;
}
let newUri = String(uri).replace(/%7B/g, '{').replace(/%7D/g, '}');

const uriVariables = newUri.match(/{\$\w*}/g);
Expand Down

0 comments on commit 5a5a7ac

Please sign in to comment.