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
37e65ec0
authored
Dec 16, 2019
by
kimvde
Committed by
Oliver Woodman
Jan 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add FlacExtractorSeekTest
PiperOrigin-RevId: 285823771
parent
fcac5af8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
library/core/src/test/java/com/google/android/exoplayer2/extractor/flac/FlacExtractorSeekTest.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java
library/core/src/test/java/com/google/android/exoplayer2/extractor/flac/FlacExtractorSeekTest.java
0 → 100644
View file @
37e65ec0
This diff is collapsed.
Click to expand it.
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java
View file @
37e65ec0
...
...
@@ -377,14 +377,15 @@ public class TestUtil {
* input until we can extract at least one sample following the seek position, or until
* end-of-input is reached.
*
* @param extractor The {@link Extractor} to extract
or
from input.
* @param extractor The {@link Extractor} to extract from input.
* @param seekMap The {@link SeekMap} of the stream from the given input.
* @param seekTimeUs The seek time, in micro-seconds.
* @param trackOutput The {@link FakeTrackOutput} to store the extracted samples.
* @param dataSource The {@link DataSource} that will be used to read from the input.
* @param uri The Uri of the input.
* @return The index of the first extracted sample written to the given {@code trackOutput} after
* the seek is completed, or -1 if the seek is completed without any extracted sample.
* the seek is completed, or {@link C#INDEX_UNSET} if the seek is completed without any
* extracted sample.
*/
public
static
int
seekToTimeUs
(
Extractor
extractor
,
...
...
@@ -420,8 +421,9 @@ public class TestUtil {
extractorInput
=
TestUtil
.
getExtractorInputFromPosition
(
dataSource
,
positionHolder
.
position
,
uri
);
extractorReadResult
=
Extractor
.
RESULT_CONTINUE
;
}
else
if
(
extractorReadResult
==
Extractor
.
RESULT_END_OF_INPUT
)
{
return
-
1
;
}
else
if
(
extractorReadResult
==
Extractor
.
RESULT_END_OF_INPUT
&&
trackOutput
.
getSampleCount
()
==
numSampleBeforeSeek
)
{
return
C
.
INDEX_UNSET
;
}
else
if
(
trackOutput
.
getSampleCount
()
>
numSampleBeforeSeek
)
{
// First index after seek = num sample before seek.
return
numSampleBeforeSeek
;
...
...
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