mirror of
https://github.com/samsonjs/media.git
synced 2026-04-21 13:55:47 +00:00
Avoid using trickplay variants for preparing an HLS stream
PiperOrigin-RevId: 324810361
This commit is contained in:
parent
71fd335bcd
commit
0670782de8
1 changed files with 9 additions and 3 deletions
|
|
@ -41,7 +41,9 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||
import com.google.android.exoplayer2.util.TimestampAdjuster;
|
||||
import com.google.android.exoplayer2.util.UriUtil;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import com.google.common.primitives.Ints;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
|
@ -151,11 +153,15 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||
}
|
||||
encryptionDataSource = dataSourceFactory.createDataSource(C.DATA_TYPE_DRM);
|
||||
trackGroup = new TrackGroup(playlistFormats);
|
||||
int[] initialTrackSelection = new int[playlistUrls.length];
|
||||
// Use only non-trickplay variants for preparation. See [Internal ref: b/161529098].
|
||||
ArrayList<Integer> initialTrackSelection = new ArrayList<>();
|
||||
for (int i = 0; i < playlistUrls.length; i++) {
|
||||
initialTrackSelection[i] = i;
|
||||
if ((playlistFormats[i].roleFlags & C.ROLE_FLAG_TRICK_PLAY) == 0) {
|
||||
initialTrackSelection.add(i);
|
||||
}
|
||||
}
|
||||
trackSelection = new InitializationTrackSelection(trackGroup, initialTrackSelection);
|
||||
trackSelection =
|
||||
new InitializationTrackSelection(trackGroup, Ints.toArray(initialTrackSelection));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue