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
4d6c9f27
authored
Dec 19, 2014
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Minor cleanup of AudioTrack.
parent
ee823a95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
library/src/main/java/com/google/android/exoplayer/audio/AudioTrack.java
library/src/main/java/com/google/android/exoplayer/audio/AudioTrack.java
View file @
4d6c9f27
...
...
@@ -361,9 +361,12 @@ public final class AudioTrack {
* written data.
*/
public
int
handleBuffer
(
ByteBuffer
buffer
,
int
offset
,
int
size
,
long
presentationTimeUs
)
{
int
result
=
0
;
if
(
size
==
0
)
{
return
RESULT_BUFFER_CONSUMED
;
}
if
(
temporaryBufferSize
==
0
&&
size
!=
0
)
{
int
result
=
0
;
if
(
temporaryBufferSize
==
0
)
{
if
(
isAc3
&&
ac3Bitrate
==
UNKNOWN_AC3_BITRATE
)
{
// Each AC-3 buffer contains 1536 frames of audio, so the AudioTrack playback position
// advances by 1536 per buffer (32 ms at 48 kHz). Calculate the bitrate in kbit/s.
...
...
@@ -393,15 +396,11 @@ public final class AudioTrack {
// number of bytes submitted.
startMediaTimeUs
+=
(
bufferStartTime
-
expectedBufferStartTime
);
startMediaTimeState
=
START_IN_SYNC
;
result
=
RESULT_POSITION_DISCONTINUITY
;
result
|
=
RESULT_POSITION_DISCONTINUITY
;
}
}
}
if
(
size
==
0
)
{
return
result
;
}
if
(
temporaryBufferSize
==
0
)
{
temporaryBufferSize
=
size
;
buffer
.
position
(
offset
);
...
...
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