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
24724158
authored
Jan 22, 2017
by
Devin Tuchsen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use ParseableByteArray to get ALAC sample rate
parent
30c59c7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegDecoder.java
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegDecoder.java
View file @
24724158
...
...
@@ -19,6 +19,7 @@ import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
import
com.google.android.exoplayer2.decoder.SimpleDecoder
;
import
com.google.android.exoplayer2.decoder.SimpleOutputBuffer
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
java.nio.ByteBuffer
;
import
java.util.List
;
...
...
@@ -88,7 +89,9 @@ import java.util.List;
if
(!
hasOutputFormat
)
{
channelCount
=
ffmpegGetChannelCount
(
nativeContext
);
if
(
"alac"
.
equals
(
codecName
))
{
sampleRate
=
ByteBuffer
.
wrap
(
extraData
,
extraData
.
length
-
4
,
4
).
getInt
();
ParsableByteArray
parsableExtraData
=
new
ParsableByteArray
(
extraData
);
parsableExtraData
.
setPosition
(
extraData
.
length
-
4
);
sampleRate
=
parsableExtraData
.
readUnsignedIntToInt
();
}
else
{
sampleRate
=
ffmpegGetSampleRate
(
nativeContext
);
}
...
...
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