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
aec6fe7e
authored
Mar 16, 2020
by
kimvde
Committed by
Oliver Woodman
Mar 19, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Notify listeners when audio session ID is set
PiperOrigin-RevId: 301187369
parent
354d5aea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 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 @
aec6fe7e
...
...
@@ -698,6 +698,9 @@ public class SimpleExoPlayer extends BasePlayer
@Override
public
void
setAudioSessionId
(
int
audioSessionId
)
{
verifyApplicationThread
();
if
(
this
.
audioSessionId
==
audioSessionId
)
{
return
;
}
this
.
audioSessionId
=
audioSessionId
;
for
(
Renderer
renderer
:
renderers
)
{
if
(
renderer
.
getTrackType
()
==
C
.
TRACK_TYPE_AUDIO
)
{
...
...
@@ -708,6 +711,9 @@ public class SimpleExoPlayer extends BasePlayer
.
send
();
}
}
if
(
audioSessionId
!=
C
.
AUDIO_SESSION_ID_UNSET
)
{
notifyAudioSessionIdSet
();
}
}
@Override
...
...
@@ -1816,6 +1822,19 @@ public class SimpleExoPlayer extends BasePlayer
}
}
private
void
notifyAudioSessionIdSet
()
{
for
(
AudioListener
audioListener
:
audioListeners
)
{
// Prevent duplicate notification if a listener is both a AudioRendererEventListener and
// a AudioListener, as they have the same method signature.
if
(!
audioDebugListeners
.
contains
(
audioListener
))
{
audioListener
.
onAudioSessionId
(
audioSessionId
);
}
}
for
(
AudioRendererEventListener
audioDebugListener
:
audioDebugListeners
)
{
audioDebugListener
.
onAudioSessionId
(
audioSessionId
);
}
}
@SuppressWarnings
(
"SuspiciousMethodCalls"
)
private
void
notifySkipSilenceEnabledChanged
()
{
for
(
AudioListener
listener
:
audioListeners
)
{
...
...
@@ -1986,16 +2005,7 @@ public class SimpleExoPlayer extends BasePlayer
return
;
}
audioSessionId
=
sessionId
;
for
(
AudioListener
audioListener
:
audioListeners
)
{
// Prevent duplicate notification if a listener is both a AudioRendererEventListener and
// a AudioListener, as they have the same method signature.
if
(!
audioDebugListeners
.
contains
(
audioListener
))
{
audioListener
.
onAudioSessionId
(
sessionId
);
}
}
for
(
AudioRendererEventListener
audioDebugListener
:
audioDebugListeners
)
{
audioDebugListener
.
onAudioSessionId
(
sessionId
);
}
notifyAudioSessionIdSet
();
}
@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