Commit 2fbe1bbf by yschimke Committed by Marc Baechinger

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
parent 30fab8c0
...@@ -1187,10 +1187,12 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -1187,10 +1187,12 @@ public final class DefaultAudioSink implements AudioSink {
if (bytesWrittenOrError < 0) { if (bytesWrittenOrError < 0) {
int error = bytesWrittenOrError; int error = bytesWrittenOrError;
boolean isRecoverable = isAudioTrackDeadObject(error);
if (isRecoverable) { // Treat a write error on a previously successful offload channel as recoverable
maybeDisableOffload(); // 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); WriteException e = new WriteException(error, configuration.inputFormat, isRecoverable);
if (listener != null) { if (listener != null) {
listener.onAudioSinkError(e); listener.onAudioSinkError(e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment