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
3101a5df
authored
Oct 21, 2019
by
ibaker
Committed by
Oliver Woodman
Oct 30, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Tweak null-handling of trackGroupToSampleQueueIndex in HlsSampleStreamWrapper
PiperOrigin-RevId: 275814023
parent
e43658af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java
View file @
3101a5df
...
@@ -360,22 +360,21 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -360,22 +360,21 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
streamResetFlags
[
i
]
=
true
;
streamResetFlags
[
i
]
=
true
;
if
(
trackGroupToSampleQueueIndex
!=
null
)
{
if
(
trackGroupToSampleQueueIndex
!=
null
)
{
((
HlsSampleStream
)
streams
[
i
]).
bindSampleQueue
();
((
HlsSampleStream
)
streams
[
i
]).
bindSampleQueue
();
}
// If there's still a chance of avoiding a seek, try and seek within the sample queue.
// If there's still a chance of avoiding a seek, try and seek within the sample queue.
if
(
sampleQueuesBuilt
&&
!
seekRequired
)
{
if
(!
seekRequired
)
{
// Must be non-null if sampleQueuesBuilt == true.
Assertions
.
checkNotNull
(
trackGroupToSampleQueueIndex
);
SampleQueue
sampleQueue
=
sampleQueues
[
trackGroupToSampleQueueIndex
[
trackGroupIndex
]];
SampleQueue
sampleQueue
=
sampleQueues
[
trackGroupToSampleQueueIndex
[
trackGroupIndex
]];
sampleQueue
.
rewind
();
sampleQueue
.
rewind
();
// A seek can be avoided if we're able to advance to the current playback position in the
// A seek can be avoided if we're able to advance to the current playback position in
// sample queue, or if we haven't read anything from the queue since the previous seek
// the sample queue, or if we haven't read anything from the queue since the previous
// (this case is common for sparse tracks such as metadata tracks). In all other cases a
// seek (this case is common for sparse tracks such as metadata tracks). In all other
// seek is required.
// cases a seek is required.
seekRequired
=
sampleQueue
.
advanceTo
(
positionUs
,
true
,
true
)
==
SampleQueue
.
ADVANCE_FAILED
seekRequired
=
sampleQueue
.
advanceTo
(
positionUs
,
true
,
true
)
==
SampleQueue
.
ADVANCE_FAILED
&&
sampleQueue
.
getReadIndex
()
!=
0
;
&&
sampleQueue
.
getReadIndex
()
!=
0
;
}
}
}
}
}
}
}
if
(
enabledTrackGroupCount
==
0
)
{
if
(
enabledTrackGroupCount
==
0
)
{
chunkSource
.
reset
();
chunkSource
.
reset
();
...
@@ -999,7 +998,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -999,7 +998,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
pendingResetUpstreamFormats
=
false
;
pendingResetUpstreamFormats
=
false
;
}
}
@RequiresNonNull
(
"trackGroupToSampleQueueIndex"
)
private
void
onTracksEnded
()
{
private
void
onTracksEnded
()
{
sampleQueuesBuilt
=
true
;
sampleQueuesBuilt
=
true
;
maybeFinishPrepare
();
maybeFinishPrepare
();
...
...
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