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
fe61cfee
authored
Dec 11, 2019
by
kimvde
Committed by
Oliver Woodman
Jan 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove duplicated logic in FlacReader
PiperOrigin-RevId: 284952647
parent
910bd8bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
28 deletions
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/FlacReader.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/FlacReader.java
View file @
fe61cfee
...
...
@@ -16,6 +16,7 @@
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
ogg
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.FlacFrameReader
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
import
com.google.android.exoplayer2.extractor.SeekPoint
;
import
com.google.android.exoplayer2.util.FlacStreamMetadata
;
...
...
@@ -84,35 +85,15 @@ import java.util.Arrays;
}
private
int
getFlacFrameBlockSize
(
ParsableByteArray
packet
)
{
int
blockSizeCode
=
(
packet
.
data
[
2
]
&
0xFF
)
>>
4
;
switch
(
blockSizeCode
)
{
case
1
:
return
192
;
case
2
:
case
3
:
case
4
:
case
5
:
return
576
<<
(
blockSizeCode
-
2
);
case
6
:
case
7
:
// skip the sample number
packet
.
skipBytes
(
FRAME_HEADER_SAMPLE_NUMBER_OFFSET
);
packet
.
readUtf8EncodedLong
();
int
value
=
blockSizeCode
==
6
?
packet
.
readUnsignedByte
()
:
packet
.
readUnsignedShort
();
packet
.
setPosition
(
0
);
return
value
+
1
;
case
8
:
case
9
:
case
10
:
case
11
:
case
12
:
case
13
:
case
14
:
case
15
:
return
256
<<
(
blockSizeCode
-
8
);
default
:
return
-
1
;
int
blockSizeKey
=
(
packet
.
data
[
2
]
&
0xFF
)
>>
4
;
if
(
blockSizeKey
==
6
||
blockSizeKey
==
7
)
{
// Skip the sample number.
packet
.
skipBytes
(
FRAME_HEADER_SAMPLE_NUMBER_OFFSET
);
packet
.
readUtf8EncodedLong
();
}
int
result
=
FlacFrameReader
.
readFrameBlockSizeSamplesFromKey
(
packet
,
blockSizeKey
);
packet
.
setPosition
(
0
);
return
result
;
}
private
class
FlacOggSeeker
implements
OggSeeker
,
SeekMap
{
...
...
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