diff --git a/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/manifest/UrlTemplate.java b/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/manifest/UrlTemplate.java index 249cedd1cd..083a1b34b3 100644 --- a/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/manifest/UrlTemplate.java +++ b/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/manifest/UrlTemplate.java @@ -100,10 +100,11 @@ public final class UrlTemplate { /** * Parses {@code template}, placing the decomposed components into the provided lists. * - *

If the return value is N, {@code urlPieces} will contain (N+1) strings that must be - * interleaved with N arguments in order to construct a url. The N identifiers that correspond to - * the required arguments, together with the tags that define their required formatting, are - * returned in {@code identifiers} and {@code identifierFormatTags} respectively. + *

If the number of identifiers in the {@code template} is N, {@code urlPieces} will contain + * (N+1) strings that must be interleaved with those N arguments in order to construct a url. The + * N identifiers that correspond to the required arguments, together with the tags that define + * their required formatting, are returned in {@code identifiers} and {@code identifierFormatTags} + * respectively. * * @param template The template to parse. * @param urlPieces A holder for pieces of url parsed from the template. @@ -122,7 +123,8 @@ public final class UrlTemplate { int dollarIndex = template.indexOf("$", templateIndex); if (dollarIndex == -1) { urlPieces.set( - identifiers.size(), urlPieces.get(identifiers.size()) + template.substring(templateIndex)); + identifiers.size(), + urlPieces.get(identifiers.size()) + template.substring(templateIndex)); templateIndex = template.length(); } else if (dollarIndex != templateIndex) { urlPieces.set(