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
52c53421
authored
Jul 07, 2016
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
getBufferedPosition can't return unknown anymore
parent
4c434005
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
library/src/main/java/com/google/android/exoplayer/MultiSampleSource.java
library/src/main/java/com/google/android/exoplayer/SampleSource.java
library/src/main/java/com/google/android/exoplayer/MultiSampleSource.java
View file @
52c53421
...
@@ -139,18 +139,14 @@ public final class MultiSampleSource implements SampleSource {
...
@@ -139,18 +139,14 @@ public final class MultiSampleSource implements SampleSource {
@Override
@Override
public
long
getBufferedPositionUs
()
{
public
long
getBufferedPositionUs
()
{
long
bufferedPositionUs
=
durationUs
!=
C
.
UNSET_TIME_US
?
durationUs
:
Long
.
MAX_VALUE
;
long
bufferedPositionUs
=
Long
.
MAX_VALUE
;
for
(
SampleSource
source
:
enabledSources
)
{
for
(
SampleSource
source
:
enabledSources
)
{
long
rendererBufferedPositionUs
=
source
.
getBufferedPositionUs
();
long
rendererBufferedPositionUs
=
source
.
getBufferedPositionUs
();
if
(
rendererBufferedPositionUs
==
C
.
UNSET_TIME_US
)
{
if
(
rendererBufferedPositionUs
!=
C
.
END_OF_SOURCE_US
)
{
return
C
.
UNSET_TIME_US
;
}
else
if
(
rendererBufferedPositionUs
==
C
.
END_OF_SOURCE_US
)
{
// This source is fully buffered.
}
else
{
bufferedPositionUs
=
Math
.
min
(
bufferedPositionUs
,
rendererBufferedPositionUs
);
bufferedPositionUs
=
Math
.
min
(
bufferedPositionUs
,
rendererBufferedPositionUs
);
}
}
}
}
return
bufferedPositionUs
==
Long
.
MAX_VALUE
?
C
.
UNSET_TIM
E_US
:
bufferedPositionUs
;
return
bufferedPositionUs
==
Long
.
MAX_VALUE
?
C
.
END_OF_SOURC
E_US
:
bufferedPositionUs
;
}
}
@Override
@Override
...
...
library/src/main/java/com/google/android/exoplayer/SampleSource.java
View file @
52c53421
...
@@ -101,8 +101,7 @@ public interface SampleSource {
...
@@ -101,8 +101,7 @@ public interface SampleSource {
* This method should only be called when at least one track is selected.
* This method should only be called when at least one track is selected.
*
*
* @return An estimate of the absolute position in microseconds up to which data is buffered, or
* @return An estimate of the absolute position in microseconds up to which data is buffered, or
* {@link C#END_OF_SOURCE_US} if the track is fully buffered, or {@link C#UNSET_TIME_US} if no
* {@link C#END_OF_SOURCE_US} if the track is fully buffered.
* estimate is available.
*/
*/
long
getBufferedPositionUs
();
long
getBufferedPositionUs
();
...
...
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