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
95ed5ce6
authored
Aug 01, 2019
by
olly
Committed by
Oliver Woodman
Aug 01, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make OggSeeker.startSeek take a granule rather than a time
PiperOrigin-RevId: 261102180
parent
cbc1385f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
17 deletions
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/FlacReader.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/OggSeeker.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/StreamReader.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java
View file @
95ed5ce6
...
...
@@ -120,12 +120,11 @@ import java.io.IOException;
}
@Override
public
long
startSeek
(
long
timeUs
)
{
public
void
startSeek
(
long
targetGranule
)
{
Assertions
.
checkArgument
(
state
==
STATE_IDLE
||
state
==
STATE_SEEK
);
t
argetGranule
=
timeUs
==
0
?
0
:
streamReader
.
convertTimeToGranule
(
timeUs
)
;
t
his
.
targetGranule
=
targetGranule
;
state
=
STATE_SEEK
;
resetSeeking
();
return
targetGranule
;
}
@Override
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/FlacReader.java
View file @
95ed5ce6
...
...
@@ -185,11 +185,9 @@ import java.util.List;
}
@Override
public
long
startSeek
(
long
timeUs
)
{
long
granule
=
convertTimeToGranule
(
timeUs
);
int
index
=
Util
.
binarySearchFloor
(
seekPointGranules
,
granule
,
true
,
true
);
public
void
startSeek
(
long
targetGranule
)
{
int
index
=
Util
.
binarySearchFloor
(
seekPointGranules
,
targetGranule
,
true
,
true
);
pendingSeekGranule
=
seekPointGranules
[
index
];
return
granule
;
}
@Override
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/OggSeeker.java
View file @
95ed5ce6
...
...
@@ -33,16 +33,14 @@ import java.io.IOException;
SeekMap
createSeekMap
();
/**
*
Initialize
s a seek operation.
*
Start
s a seek operation.
*
* @param timeUs The seek position in microseconds.
* @return The granule position targeted by the seek.
* @param targetGranule The target granule position.
*/
long
startSeek
(
long
timeUs
);
void
startSeek
(
long
targetGranule
);
/**
* Reads data from the {@link ExtractorInput} to build the {@link SeekMap} or to continue a
* progressive seek.
* Reads data from the {@link ExtractorInput} to build the {@link SeekMap} or to continue a seek.
* <p/>
* If more data is required or if the position of the input needs to be modified then a position
* from which data should be provided is returned. Else a negative value is returned. If a seek
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/StreamReader.java
View file @
95ed5ce6
...
...
@@ -91,7 +91,8 @@ import java.io.IOException;
reset
(!
seekMapSet
);
}
else
{
if
(
state
!=
STATE_READ_HEADERS
)
{
targetGranule
=
oggSeeker
.
startSeek
(
timeUs
);
targetGranule
=
convertTimeToGranule
(
timeUs
);
oggSeeker
.
startSeek
(
targetGranule
);
state
=
STATE_READ_PAYLOAD
;
}
}
...
...
@@ -248,13 +249,13 @@ import java.io.IOException;
private
static
final
class
UnseekableOggSeeker
implements
OggSeeker
{
@Override
public
long
read
(
ExtractorInput
input
)
throws
IOException
,
InterruptedException
{
public
long
read
(
ExtractorInput
input
)
{
return
-
1
;
}
@Override
public
long
startSeek
(
long
timeUs
)
{
return
0
;
public
void
startSeek
(
long
targetGranule
)
{
// Do nothing.
}
@Override
...
...
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