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
5f74226d
authored
Apr 17, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make the audio track session workaround flag non-final.
parent
508e13e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 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 @
5f74226d
...
@@ -93,12 +93,6 @@ public final class AudioTrack {
...
@@ -93,12 +93,6 @@ public final class AudioTrack {
/** Returned by {@link #getCurrentPositionUs} when the position is not set. */
/** Returned by {@link #getCurrentPositionUs} when the position is not set. */
public
static
final
long
CURRENT_POSITION_NOT_SET
=
Long
.
MIN_VALUE
;
public
static
final
long
CURRENT_POSITION_NOT_SET
=
Long
.
MIN_VALUE
;
/**
* Set to {@code true} to enable a workaround for an issue where an audio effect does not keep its
* session active across releasing/initializing a new audio track, on platform API version < 21.
*/
private
static
final
boolean
ENABLE_PRE_V21_AUDIO_SESSION_WORKAROUND
=
false
;
/** A minimum length for the {@link android.media.AudioTrack} buffer, in microseconds. */
/** A minimum length for the {@link android.media.AudioTrack} buffer, in microseconds. */
private
static
final
long
MIN_BUFFER_DURATION_US
=
250000
;
private
static
final
long
MIN_BUFFER_DURATION_US
=
250000
;
/** A maximum length for the {@link android.media.AudioTrack} buffer, in microseconds. */
/** A maximum length for the {@link android.media.AudioTrack} buffer, in microseconds. */
...
@@ -137,6 +131,13 @@ public final class AudioTrack {
...
@@ -137,6 +131,13 @@ public final class AudioTrack {
private
static
final
int
MIN_PLAYHEAD_OFFSET_SAMPLE_INTERVAL_US
=
30000
;
private
static
final
int
MIN_PLAYHEAD_OFFSET_SAMPLE_INTERVAL_US
=
30000
;
private
static
final
int
MIN_TIMESTAMP_SAMPLE_INTERVAL_US
=
500000
;
private
static
final
int
MIN_TIMESTAMP_SAMPLE_INTERVAL_US
=
500000
;
/**
* Set to {@code true} to enable a workaround for an issue where an audio effect does not keep its
* session active across releasing/initializing a new audio track, on platform API version < 21.
* The flag must be set before creating the player.
*/
public
static
boolean
enablePreV21AudioSessionWorkaround
=
false
;
private
final
ConditionVariable
releasingConditionVariable
;
private
final
ConditionVariable
releasingConditionVariable
;
private
final
long
[]
playheadOffsets
;
private
final
long
[]
playheadOffsets
;
...
@@ -281,7 +282,7 @@ public final class AudioTrack {
...
@@ -281,7 +282,7 @@ public final class AudioTrack {
checkAudioTrackInitialized
();
checkAudioTrackInitialized
();
sessionId
=
audioTrack
.
getAudioSessionId
();
sessionId
=
audioTrack
.
getAudioSessionId
();
if
(
ENABLE_PRE_V21_AUDIO_SESSION_WORKAROUND
)
{
if
(
enablePreV21AudioSessionWorkaround
)
{
if
(
Util
.
SDK_INT
<
21
)
{
if
(
Util
.
SDK_INT
<
21
)
{
// The workaround creates an audio track with a one byte buffer on the same session, and
// The workaround creates an audio track with a one byte buffer on the same session, and
// does not release it until this object is released, which keeps the session active.
// does not release it until this object is released, which keeps the session active.
...
...
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