Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0670782d
authored
Aug 04, 2020
by
aquilescanta
Committed by
kim-vde
Aug 07, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Avoid using trickplay variants for preparing an HLS stream
PiperOrigin-RevId: 324810361
parent
71fd335b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java
View file @
0670782d
...
...
@@ -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
));
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment