mirror of
https://github.com/samsonjs/media.git
synced 2026-04-02 10:45:51 +00:00
Change copyRenditionsList parameters names
Also instantiate the resulting list with a predicted size to minimize list resizing. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=163332285
This commit is contained in:
parent
0a2f485079
commit
a7032ede38
1 changed files with 9 additions and 9 deletions
|
|
@ -118,8 +118,8 @@ public final class HlsMasterPlaylist extends HlsPlaylist {
|
|||
* urls.
|
||||
*/
|
||||
public HlsMasterPlaylist copy(List<String> renditionUrls) {
|
||||
return new HlsMasterPlaylist(baseUri, tags, copyRenditionList(variants, renditionUrls),
|
||||
copyRenditionList(audios, renditionUrls), copyRenditionList(subtitles, renditionUrls),
|
||||
return new HlsMasterPlaylist(baseUri, tags, copyRenditionsList(variants, renditionUrls),
|
||||
copyRenditionsList(audios, renditionUrls), copyRenditionsList(subtitles, renditionUrls),
|
||||
muxedAudioFormat, muxedCaptionFormats);
|
||||
}
|
||||
|
||||
|
|
@ -136,15 +136,15 @@ public final class HlsMasterPlaylist extends HlsPlaylist {
|
|||
emptyList, null, null);
|
||||
}
|
||||
|
||||
private static List<HlsUrl> copyRenditionList(List<HlsUrl> variants, List<String> variantUrls) {
|
||||
List<HlsUrl> copyVariants = new ArrayList<>();
|
||||
for (int i = 0; i < variants.size(); i++) {
|
||||
HlsUrl variant = variants.get(i);
|
||||
if (variantUrls.contains(variant.url)) {
|
||||
copyVariants.add(variant);
|
||||
private static List<HlsUrl> copyRenditionsList(List<HlsUrl> renditions, List<String> urls) {
|
||||
List<HlsUrl> copiedRenditions = new ArrayList<>(urls.size());
|
||||
for (int i = 0; i < renditions.size(); i++) {
|
||||
HlsUrl rendition = renditions.get(i);
|
||||
if (urls.contains(rendition.url)) {
|
||||
copiedRenditions.add(rendition);
|
||||
}
|
||||
}
|
||||
return copyVariants;
|
||||
return copiedRenditions;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue