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
56cb327f
authored
Sep 24, 2020
by
krocard
Committed by
kim-vde
Sep 25, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clarify offload stream event callback impl
#exo-offload PiperOrigin-RevId: 333532900
parent
55a13d88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java
library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java
View file @
56cb327f
...
@@ -1707,17 +1707,19 @@ public final class DefaultAudioSink implements AudioSink {
...
@@ -1707,17 +1707,19 @@ public final class DefaultAudioSink implements AudioSink {
@Override
@Override
public
void
onDataRequest
(
AudioTrack
track
,
int
size
)
{
public
void
onDataRequest
(
AudioTrack
track
,
int
size
)
{
Assertions
.
checkState
(
track
==
DefaultAudioSink
.
this
.
audioTrack
);
Assertions
.
checkState
(
track
==
audioTrack
);
if
(
listener
!=
null
)
{
if
(
listener
!=
null
&&
playing
)
{
// Do not signal that the buffer is emptying if not playing as it is a transient state.
listener
.
onOffloadBufferEmptying
();
listener
.
onOffloadBufferEmptying
();
}
}
}
}
@Override
@Override
public
void
onTearDown
(
@NonNull
AudioTrack
track
)
{
public
void
onTearDown
(
@NonNull
AudioTrack
track
)
{
Assertions
.
checkState
(
track
==
audioTrack
);
if
(
listener
!=
null
&&
playing
)
{
if
(
listener
!=
null
&&
playing
)
{
//
A new Audio Track needs to be created and it's buffer filled, which will be done on the
//
The audio track was destroyed while in use. Thus a new AudioTrack needs to be created
// next handleBuffer call.
//
and its buffer filled, which will be done on the
next handleBuffer call.
// Request this call explicitly in case ExoPlayer is sleeping waiting for a data request.
// Request this call explicitly in case ExoPlayer is sleeping waiting for a data request.
listener
.
onOffloadBufferEmptying
();
listener
.
onOffloadBufferEmptying
();
}
}
...
...
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