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
2214a4c1
authored
Jan 14, 2017
by
WeiChungChang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
'refine_to_make_flow_simpler'
parent
cb0394b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
29 deletions
library/src/main/java/com/google/android/exoplayer2/extractor/DefaultTrackOutput.java
library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSampleStream.java
library/src/main/java/com/google/android/exoplayer2/extractor/DefaultTrackOutput.java
View file @
2214a4c1
...
@@ -248,12 +248,7 @@ public final class DefaultTrackOutput implements TrackOutput {
...
@@ -248,12 +248,7 @@ public final class DefaultTrackOutput implements TrackOutput {
* @return Whether the skip was successful.
* @return Whether the skip was successful.
*/
*/
public
boolean
skipToKeyframeBefore
(
long
timeUs
)
{
public
boolean
skipToKeyframeBefore
(
long
timeUs
)
{
long
nextOffset
=
infoQueue
.
skipToKeyframeBefore
(
timeUs
,
false
);
return
infoQueue
.
skipToKeyframeBefore
(
timeUs
,
false
);
if
(
nextOffset
==
C
.
POSITION_UNSET
)
{
return
false
;
}
dropDownstreamTo
(
nextOffset
);
return
true
;
}
}
/**
/**
...
...
library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSampleStream.java
View file @
2214a4c1
...
@@ -115,20 +115,6 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
...
@@ -115,20 +115,6 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
}
}
/**
/**
* Check if the input position locates within the chunk we are downloading now.
*
* @param positionUs The target position in microseconds.
* @return Whether the input position locates within the chunk we are downloading now.
*/
public
boolean
isWithinLastChunk
(
long
positionUs
)
{
if
(
isPendingReset
()
||
loadingFinished
)
{
return
false
;
}
else
{
return
((
positionUs
>=
getCurrentLoadPositionUs
())
&&
(
positionUs
<
getNextLoadPositionUs
()));
}
}
/**
* Seeks to the specified position in microseconds.
* Seeks to the specified position in microseconds.
*
*
* @param positionUs The seek position in microseconds.
* @param positionUs The seek position in microseconds.
...
@@ -137,7 +123,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
...
@@ -137,7 +123,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
lastSeekPositionUs
=
positionUs
;
lastSeekPositionUs
=
positionUs
;
// If we're not pending a reset, see if we can seek within the sample queue.
// If we're not pending a reset, see if we can seek within the sample queue.
boolean
seekInsideBuffer
=
!
isPendingReset
()
&&
boolean
seekInsideBuffer
=
!
isPendingReset
()
&&
sampleQueue
.
skipToKeyframeBefore
(
positionUs
,
isWithinLastChunk
(
positionUs
));
sampleQueue
.
skipToKeyframeBefore
(
positionUs
,
(
positionUs
<
getNextLoadPositionUs
()
));
if
(
seekInsideBuffer
)
{
if
(
seekInsideBuffer
)
{
// We succeeded. All we need to do is discard any chunks that we've moved past.
// We succeeded. All we need to do is discard any chunks that we've moved past.
while
(
mediaChunks
.
size
()
>
1
while
(
mediaChunks
.
size
()
>
1
...
@@ -299,14 +285,6 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
...
@@ -299,14 +285,6 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
return
true
;
return
true
;
}
}
public
long
getCurrentLoadPositionUs
()
{
if
(
isPendingReset
())
{
return
pendingResetPositionUs
;
}
else
{
return
loadingFinished
?
C
.
TIME_END_OF_SOURCE
:
mediaChunks
.
getLast
().
startTimeUs
;
}
}
@Override
@Override
public
long
getNextLoadPositionUs
()
{
public
long
getNextLoadPositionUs
()
{
if
(
isPendingReset
())
{
if
(
isPendingReset
())
{
...
...
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