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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 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,19 +360,18 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -360,19 +360,18 @@ 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
(!
seekRequired
)
{
if
(
sampleQueuesBuilt
&&
!
seekRequired
)
{
SampleQueue
sampleQueue
=
sampleQueues
[
trackGroupToSampleQueueIndex
[
trackGroupIndex
]];
// Must be non-null if sampleQueuesBuilt == true.
sampleQueue
.
rewind
();
Assertions
.
checkNotNull
(
trackGroupToSampleQueueIndex
);
// A seek can be avoided if we're able to advance to the current playback position in
SampleQueue
sampleQueue
=
sampleQueues
[
trackGroupToSampleQueueIndex
[
trackGroupIndex
]];
// the sample queue, or if we haven't read anything from the queue since the previous
sampleQueue
.
rewind
();
// seek (this case is common for sparse tracks such as metadata tracks). In all other
// A seek can be avoided if we're able to advance to the current playback position in the
// cases a seek is required.
// sample queue, or if we haven't read anything from the queue since the previous seek
seekRequired
=
// (this case is common for sparse tracks such as metadata tracks). In all other cases a
sampleQueue
.
advanceTo
(
positionUs
,
true
,
true
)
==
SampleQueue
.
ADVANCE_FAILED
// seek is required.
&&
sampleQueue
.
getReadIndex
()
!=
0
;
seekRequired
=
sampleQueue
.
advanceTo
(
positionUs
,
true
,
true
)
==
SampleQueue
.
ADVANCE_FAILED
}
&&
sampleQueue
.
getReadIndex
()
!=
0
;
}
}
}
}
}
}
...
@@ -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