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
3ec4ec4d
authored
Jun 12, 2020
by
aquilescanta
Committed by
Andrew Lewis
Jun 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make ChunkExtractor.read return a boolean instead of an int
PiperOrigin-RevId: 316172860
parent
41d4a132
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
17 deletions
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/BundledChunkExtractor.java
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkExtractor.java
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/ContainerMediaChunk.java
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/InitializationChunk.java
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/BundledChunkExtractor.java
View file @
3ec4ec4d
...
@@ -105,8 +105,10 @@ public final class BundledChunkExtractor implements ExtractorOutput, ChunkExtrac
...
@@ -105,8 +105,10 @@ public final class BundledChunkExtractor implements ExtractorOutput, ChunkExtrac
}
}
@Override
@Override
public
int
read
(
ExtractorInput
input
)
throws
IOException
{
public
boolean
read
(
ExtractorInput
input
)
throws
IOException
{
return
extractor
.
read
(
input
,
DUMMY_POSITION_HOLDER
);
int
result
=
extractor
.
read
(
input
,
DUMMY_POSITION_HOLDER
);
Assertions
.
checkState
(
result
!=
Extractor
.
RESULT_SEEK
);
return
result
==
Extractor
.
RESULT_CONTINUE
;
}
}
// ExtractorOutput implementation.
// ExtractorOutput implementation.
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkExtractor.java
View file @
3ec4ec4d
...
@@ -19,7 +19,6 @@ import androidx.annotation.Nullable;
...
@@ -19,7 +19,6 @@ import androidx.annotation.Nullable;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.extractor.ChunkIndex
;
import
com.google.android.exoplayer2.extractor.ChunkIndex
;
import
com.google.android.exoplayer2.extractor.Extractor
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.TrackOutput
;
import
com.google.android.exoplayer2.extractor.TrackOutput
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -79,8 +78,9 @@ public interface ChunkExtractor {
...
@@ -79,8 +78,9 @@ public interface ChunkExtractor {
* Reads from the given {@link ExtractorInput}.
* Reads from the given {@link ExtractorInput}.
*
*
* @param input The input to read from.
* @param input The input to read from.
* @return One of the {@link Extractor}{@code .RESULT_*} values.
* @return Whether there is any data left to extract. Returns false if the end of input has been
* reached.
* @throws IOException If an error occurred reading from or parsing the input.
* @throws IOException If an error occurred reading from or parsing the input.
*/
*/
int
read
(
ExtractorInput
input
)
throws
IOException
;
boolean
read
(
ExtractorInput
input
)
throws
IOException
;
}
}
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/ContainerMediaChunk.java
View file @
3ec4ec4d
...
@@ -24,7 +24,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
...
@@ -24,7 +24,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
import
com.google.android.exoplayer2.source.chunk.ChunkExtractor.TrackOutputProvider
;
import
com.google.android.exoplayer2.source.chunk.ChunkExtractor.TrackOutputProvider
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DataSpec
;
import
com.google.android.exoplayer2.upstream.DataSpec
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -127,11 +126,7 @@ public class ContainerMediaChunk extends BaseMediaChunk {
...
@@ -127,11 +126,7 @@ public class ContainerMediaChunk extends BaseMediaChunk {
dataSource
,
loadDataSpec
.
position
,
dataSource
.
open
(
loadDataSpec
));
dataSource
,
loadDataSpec
.
position
,
dataSource
.
open
(
loadDataSpec
));
// Load and decode the sample data.
// Load and decode the sample data.
try
{
try
{
int
result
=
Extractor
.
RESULT_CONTINUE
;
while
(!
loadCanceled
&&
chunkExtractor
.
read
(
input
))
{}
while
(
result
==
Extractor
.
RESULT_CONTINUE
&&
!
loadCanceled
)
{
result
=
chunkExtractor
.
read
(
input
);
}
Assertions
.
checkState
(
result
!=
Extractor
.
RESULT_SEEK
);
}
finally
{
}
finally
{
nextLoadPosition
=
input
.
getPosition
()
-
dataSpec
.
position
;
nextLoadPosition
=
input
.
getPosition
()
-
dataSpec
.
position
;
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/InitializationChunk.java
View file @
3ec4ec4d
...
@@ -24,7 +24,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
...
@@ -24,7 +24,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
import
com.google.android.exoplayer2.source.chunk.ChunkExtractor.TrackOutputProvider
;
import
com.google.android.exoplayer2.source.chunk.ChunkExtractor.TrackOutputProvider
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DataSpec
;
import
com.google.android.exoplayer2.upstream.DataSpec
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.IOException
;
import
java.io.IOException
;
import
org.checkerframework.checker.nullness.qual.MonotonicNonNull
;
import
org.checkerframework.checker.nullness.qual.MonotonicNonNull
;
...
@@ -93,11 +92,7 @@ public final class InitializationChunk extends Chunk {
...
@@ -93,11 +92,7 @@ public final class InitializationChunk extends Chunk {
dataSource
,
loadDataSpec
.
position
,
dataSource
.
open
(
loadDataSpec
));
dataSource
,
loadDataSpec
.
position
,
dataSource
.
open
(
loadDataSpec
));
// Load and decode the initialization data.
// Load and decode the initialization data.
try
{
try
{
int
result
=
Extractor
.
RESULT_CONTINUE
;
while
(!
loadCanceled
&&
chunkExtractor
.
read
(
input
))
{}
while
(
result
==
Extractor
.
RESULT_CONTINUE
&&
!
loadCanceled
)
{
result
=
chunkExtractor
.
read
(
input
);
}
Assertions
.
checkState
(
result
!=
Extractor
.
RESULT_SEEK
);
}
finally
{
}
finally
{
nextLoadPosition
=
input
.
getPosition
()
-
dataSpec
.
position
;
nextLoadPosition
=
input
.
getPosition
()
-
dataSpec
.
position
;
}
}
...
...
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