Commit 150b3cdb by Oliver Woodman

Call AudioTrack.flush() before AudioTrack.release().

On NVIDIA Shield, recreated passthrough AudioTracks have incorrect playback head
positions, due to shared state with the previously destroyed passthrough
AudioTrack. Calling AudioTrack.flush() before AudioTrack.release() ensures this
state is cleared.

This is a safe change so I have not made it a device-specific workaround. The
combined time for flush and release is less than 10 ms (with flush normally
taking less than two ms).
parent f129812b
...@@ -611,6 +611,7 @@ public final class AudioTrack { ...@@ -611,6 +611,7 @@ public final class AudioTrack {
@Override @Override
public void run() { public void run() {
try { try {
toRelease.flush();
toRelease.release(); toRelease.release();
} finally { } finally {
releasingConditionVariable.open(); releasingConditionVariable.open();
......
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