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
a1083d36
authored
May 08, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Prevent wrapping detection on new passthrough AudioTracks.
parent
de5bce34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 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 @
a1083d36
...
@@ -790,9 +790,15 @@ public final class AudioTrack {
...
@@ -790,9 +790,15 @@ public final class AudioTrack {
public
long
getPlaybackHeadPosition
()
{
public
long
getPlaybackHeadPosition
()
{
long
rawPlaybackHeadPosition
=
0xFFFFFFFF
L
&
audioTrack
.
getPlaybackHeadPosition
();
long
rawPlaybackHeadPosition
=
0xFFFFFFFF
L
&
audioTrack
.
getPlaybackHeadPosition
();
if
(
Util
.
SDK_INT
<=
22
&&
isPassthrough
)
{
if
(
Util
.
SDK_INT
<=
22
&&
isPassthrough
)
{
// Work around an issue on platform API versions 21/22 where the playback head position
// Work around issues with passthrough/direct AudioTracks on platform API versions 21/22:
// jumps back to zero on paused passthrough/direct audio tracks. See [Internal: b/19187573].
// - After resetting, the new AudioTrack's playback position continues to increase for a
if
(
audioTrack
.
getPlayState
()
==
android
.
media
.
AudioTrack
.
PLAYSTATE_PAUSED
// short time from the old AudioTrack's position, while in the PLAYSTATE_STOPPED state.
// - The playback head position jumps back to zero on paused passthrough/direct audio
// tracks. See [Internal: b/19187573].
if
(
audioTrack
.
getPlayState
()
==
android
.
media
.
AudioTrack
.
PLAYSTATE_STOPPED
)
{
// Prevent detecting a wrapped position.
lastRawPlaybackHeadPosition
=
rawPlaybackHeadPosition
;
}
else
if
(
audioTrack
.
getPlayState
()
==
android
.
media
.
AudioTrack
.
PLAYSTATE_PAUSED
&&
rawPlaybackHeadPosition
==
0
)
{
&&
rawPlaybackHeadPosition
==
0
)
{
passthroughWorkaroundPauseOffset
=
lastRawPlaybackHeadPosition
;
passthroughWorkaroundPauseOffset
=
lastRawPlaybackHeadPosition
;
}
}
...
...
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