Increase attempts to start AudioRecord

Making the shell app foreground (specific for Android 11) may take more
than 300ms on some devices, so increase the number of attempts from 3 to
5 (separated by 100ms).

Fixes #4147 <https://github.com/Genymobile/scrcpy/issues/4147>
Refs #3796 <https://github.com/Genymobile/scrcpy/issues/3796>
Refs 02f4ff7534
doc
Romain Vimont 11 months ago
parent fe6e9acb36
commit 01d785d9a3

@ -118,7 +118,7 @@ public final class AudioCapture {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
startWorkaroundAndroid11();
try {
tryStartRecording(3, 100);
tryStartRecording(5, 100);
} finally {
stopWorkaroundAndroid11();
}

Loading…
Cancel
Save