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
ff82a132
authored
Oct 25, 2019
by
samrobinson
Committed by
Oliver Woodman
Oct 30, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add player release check to enabling audio focus & audio becoming noisy handling.
PiperOrigin-RevId: 276679790
parent
719a704d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
View file @
ff82a132
...
@@ -348,6 +348,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -348,6 +348,7 @@ public class SimpleExoPlayer extends BasePlayer
private
boolean
hasNotifiedFullWrongThreadWarning
;
private
boolean
hasNotifiedFullWrongThreadWarning
;
@Nullable
private
PriorityTaskManager
priorityTaskManager
;
@Nullable
private
PriorityTaskManager
priorityTaskManager
;
private
boolean
isPriorityTaskManagerRegistered
;
private
boolean
isPriorityTaskManagerRegistered
;
private
boolean
playerReleased
;
/**
/**
* @param context A {@link Context}.
* @param context A {@link Context}.
...
@@ -641,6 +642,9 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -641,6 +642,9 @@ public class SimpleExoPlayer extends BasePlayer
@Override
@Override
public
void
setAudioAttributes
(
AudioAttributes
audioAttributes
,
boolean
handleAudioFocus
)
{
public
void
setAudioAttributes
(
AudioAttributes
audioAttributes
,
boolean
handleAudioFocus
)
{
verifyApplicationThread
();
verifyApplicationThread
();
if
(
playerReleased
)
{
return
;
}
if
(!
Util
.
areEqual
(
this
.
audioAttributes
,
audioAttributes
))
{
if
(!
Util
.
areEqual
(
this
.
audioAttributes
,
audioAttributes
))
{
this
.
audioAttributes
=
audioAttributes
;
this
.
audioAttributes
=
audioAttributes
;
for
(
Renderer
renderer
:
renderers
)
{
for
(
Renderer
renderer
:
renderers
)
{
...
@@ -778,6 +782,9 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -778,6 +782,9 @@ public class SimpleExoPlayer extends BasePlayer
*/
*/
public
void
setHandleAudioBecomingNoisy
(
boolean
handleAudioBecomingNoisy
)
{
public
void
setHandleAudioBecomingNoisy
(
boolean
handleAudioBecomingNoisy
)
{
verifyApplicationThread
();
verifyApplicationThread
();
if
(
playerReleased
)
{
return
;
}
audioBecomingNoisyManager
.
setEnabled
(
handleAudioBecomingNoisy
);
audioBecomingNoisyManager
.
setEnabled
(
handleAudioBecomingNoisy
);
}
}
...
@@ -1278,6 +1285,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -1278,6 +1285,7 @@ public class SimpleExoPlayer extends BasePlayer
}
}
bandwidthMeter
.
removeEventListener
(
analyticsCollector
);
bandwidthMeter
.
removeEventListener
(
analyticsCollector
);
currentCues
=
Collections
.
emptyList
();
currentCues
=
Collections
.
emptyList
();
playerReleased
=
true
;
}
}
@Override
@Override
...
...
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