mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
AudioOffload recovery.
Avoids disabling Offload on a write error, and instead relies on this being disabled on the AudioTrack init. It will no longer recover by disabling offload.
PiperOrigin-RevId: 465248917
(cherry picked from commit a10af8ecda)
This commit is contained in:
parent
46f267700f
commit
e5f17f44d5
1 changed files with 6 additions and 4 deletions
|
|
@ -1196,10 +1196,12 @@ public final class DefaultAudioSink implements AudioSink {
|
|||
|
||||
if (bytesWrittenOrError < 0) {
|
||||
int error = bytesWrittenOrError;
|
||||
boolean isRecoverable = isAudioTrackDeadObject(error);
|
||||
if (isRecoverable) {
|
||||
maybeDisableOffload();
|
||||
}
|
||||
|
||||
// Treat a write error on a previously successful offload channel as recoverable
|
||||
// without disabling offload. Offload will be disabled when a new AudioTrack is created,
|
||||
// if no longer supported.
|
||||
boolean isRecoverable = isAudioTrackDeadObject(error) && writtenEncodedFrames > 0;
|
||||
|
||||
WriteException e = new WriteException(error, configuration.inputFormat, isRecoverable);
|
||||
if (listener != null) {
|
||||
listener.onAudioSinkError(e);
|
||||
|
|
|
|||
Loading…
Reference in a new issue