Skip to content

Commit

Permalink
fix(HLS): Avoid variable substitution if no variables (#5269)
Browse files Browse the repository at this point in the history
With this change, we improve performance on very large playlists.
  • Loading branch information
avelad authored and JulianDomingo committed Jun 20, 2023
1 parent 41c1ace commit b549b60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,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 b549b60

Please sign in to comment.