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
5c8b5e5b
authored
Jan 04, 2022
by
tonihei
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #9777 from TiVo:p-optimize-timestampadjuster-wait
PiperOrigin-RevId: 417769018
parents
bb1357b6
6d8588fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
RELEASENOTES.md
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaChunk.java
RELEASENOTES.md
View file @
5c8b5e5b
...
@@ -67,6 +67,8 @@
...
@@ -67,6 +67,8 @@
(
[
#2882
](
https://github.com/google/ExoPlayer/issues/2882
)
).
(
[
#2882
](
https://github.com/google/ExoPlayer/issues/2882
)
).
*
Correctly populate
`Format.label`
for audio only HLS streams
*
Correctly populate
`Format.label`
for audio only HLS streams
(
[
#9608
](
https://github.com/google/ExoPlayer/issues/9608
)
).
(
[
#9608
](
https://github.com/google/ExoPlayer/issues/9608
)
).
*
Timestamp adjuster initialization occurs after opening the
`DataSource`
(
[
#9777
](
https://github.com/google/ExoPlayer/pull/9777
)
).
*
UI:
*
UI:
*
Fix the color of the numbers in
`StyledPlayerView`
rewind and
*
Fix the color of the numbers in
`StyledPlayerView`
rewind and
fastforward buttons when using certain themes
fastforward buttons when using certain themes
...
...
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaChunk.java
View file @
5c8b5e5b
...
@@ -423,19 +423,19 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -423,19 +423,19 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
// initDataLoadRequired => initDataSource != null && initDataSpec != null
// initDataLoadRequired => initDataSource != null && initDataSpec != null
Assertions
.
checkNotNull
(
initDataSource
);
Assertions
.
checkNotNull
(
initDataSource
);
Assertions
.
checkNotNull
(
initDataSpec
);
Assertions
.
checkNotNull
(
initDataSpec
);
feedDataToExtractor
(
initDataSource
,
initDataSpec
,
initSegmentEncrypted
);
feedDataToExtractor
(
initDataSource
,
initDataSpec
,
initSegmentEncrypted
,
/* initializeTimestampAdjuster= */
false
);
nextLoadPosition
=
0
;
nextLoadPosition
=
0
;
initDataLoadRequired
=
false
;
initDataLoadRequired
=
false
;
}
}
@RequiresNonNull
(
"output"
)
@RequiresNonNull
(
"output"
)
private
void
loadMedia
()
throws
IOException
{
private
void
loadMedia
()
throws
IOException
{
try
{
feedDataToExtractor
(
timestampAdjuster
.
sharedInitializeOrWait
(
isMasterTimestampSource
,
startTimeUs
);
dataSource
,
dataSpec
,
mediaSegmentEncrypted
,
/* initializeTimestampAdjuster= */
true
);
}
catch
(
InterruptedException
e
)
{
throw
new
InterruptedIOException
();
}
feedDataToExtractor
(
dataSource
,
dataSpec
,
mediaSegmentEncrypted
);
}
}
/**
/**
...
@@ -445,7 +445,11 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -445,7 +445,11 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
*/
*/
@RequiresNonNull
(
"output"
)
@RequiresNonNull
(
"output"
)
private
void
feedDataToExtractor
(
private
void
feedDataToExtractor
(
DataSource
dataSource
,
DataSpec
dataSpec
,
boolean
dataIsEncrypted
)
throws
IOException
{
DataSource
dataSource
,
DataSpec
dataSpec
,
boolean
dataIsEncrypted
,
boolean
initializeTimestampAdjuster
)
throws
IOException
{
// If we previously fed part of this chunk to the extractor, we need to skip it this time. For
// If we previously fed part of this chunk to the extractor, we need to skip it this time. For
// encrypted content we need to skip the data by reading it through the source, so as to ensure
// encrypted content we need to skip the data by reading it through the source, so as to ensure
// correct decryption of the remainder of the chunk. For clear content, we can request the
// correct decryption of the remainder of the chunk. For clear content, we can request the
...
@@ -460,7 +464,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -460,7 +464,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
skipLoadedBytes
=
false
;
skipLoadedBytes
=
false
;
}
}
try
{
try
{
ExtractorInput
input
=
prepareExtraction
(
dataSource
,
loadDataSpec
);
ExtractorInput
input
=
prepareExtraction
(
dataSource
,
loadDataSpec
,
initializeTimestampAdjuster
);
if
(
skipLoadedBytes
)
{
if
(
skipLoadedBytes
)
{
input
.
skipFully
(
nextLoadPosition
);
input
.
skipFully
(
nextLoadPosition
);
}
}
...
@@ -484,9 +489,17 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -484,9 +489,17 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@RequiresNonNull
(
"output"
)
@RequiresNonNull
(
"output"
)
@EnsuresNonNull
(
"extractor"
)
@EnsuresNonNull
(
"extractor"
)
private
DefaultExtractorInput
prepareExtraction
(
DataSource
dataSource
,
DataSpec
dataSpec
)
private
DefaultExtractorInput
prepareExtraction
(
DataSource
dataSource
,
DataSpec
dataSpec
,
boolean
initializeTimestampAdjuster
)
throws
IOException
{
throws
IOException
{
long
bytesToRead
=
dataSource
.
open
(
dataSpec
);
long
bytesToRead
=
dataSource
.
open
(
dataSpec
);
if
(
initializeTimestampAdjuster
)
{
try
{
timestampAdjuster
.
sharedInitializeOrWait
(
isMasterTimestampSource
,
startTimeUs
);
}
catch
(
InterruptedException
e
)
{
throw
new
InterruptedIOException
();
}
}
DefaultExtractorInput
extractorInput
=
DefaultExtractorInput
extractorInput
=
new
DefaultExtractorInput
(
dataSource
,
dataSpec
.
position
,
bytesToRead
);
new
DefaultExtractorInput
(
dataSource
,
dataSpec
.
position
,
bytesToRead
);
...
...
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