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
7a0f00ce
authored
Sep 01, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
No-op setting volume to current volume.
parent
3c65df92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 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 @
7a0f00ce
...
...
@@ -357,7 +357,7 @@ public final class AudioTrack {
}
audioTrackUtil
.
reconfigure
(
audioTrack
,
isPassthrough
());
set
Volume
(
volume
);
set
AudioTrackVolume
(
);
return
sessionId
;
}
...
...
@@ -582,23 +582,29 @@ public final class AudioTrack {
/** Sets the playback volume. */
public
void
setVolume
(
float
volume
)
{
this
.
volume
=
volume
;
if
(
isInitialized
())
{
if
(
Util
.
SDK_INT
>=
21
)
{
setVolumeV21
(
audioTrack
,
volume
);
}
else
{
setVolumeV3
(
audioTrack
,
volume
);
}
if
(
this
.
volume
!=
volume
)
{
this
.
volume
=
volume
;
setAudioTrackVolume
();
}
}
private
void
setAudioTrackVolume
()
{
if
(!
isInitialized
())
{
// Do nothing.
}
else
if
(
Util
.
SDK_INT
>=
21
)
{
setAudioTrackVolumeV21
(
audioTrack
,
volume
);
}
else
{
setAudioTrackVolumeV3
(
audioTrack
,
volume
);
}
}
@TargetApi
(
21
)
private
static
void
setVolumeV21
(
android
.
media
.
AudioTrack
audioTrack
,
float
volume
)
{
private
static
void
set
AudioTrack
VolumeV21
(
android
.
media
.
AudioTrack
audioTrack
,
float
volume
)
{
audioTrack
.
setVolume
(
volume
);
}
@SuppressWarnings
(
"deprecation"
)
private
static
void
setVolumeV3
(
android
.
media
.
AudioTrack
audioTrack
,
float
volume
)
{
private
static
void
set
AudioTrack
VolumeV3
(
android
.
media
.
AudioTrack
audioTrack
,
float
volume
)
{
audioTrack
.
setStereoVolume
(
volume
,
volume
);
}
...
...
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