mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-06-16 22:01:14 +00:00
Fix brown-paper-bag bug in audio init error checking
This commit is contained in:
@@ -149,6 +149,7 @@ public class AndroidAudioRenderer implements AudioRenderer {
|
|||||||
break;
|
break;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Try to release the AudioTrack if we got far enough
|
// Try to release the AudioTrack if we got far enough
|
||||||
|
e.printStackTrace();
|
||||||
try {
|
try {
|
||||||
if (track != null) {
|
if (track != null) {
|
||||||
track.release();
|
track.release();
|
||||||
@@ -158,6 +159,11 @@ public class AndroidAudioRenderer implements AudioRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (track == null) {
|
||||||
|
// Couldn't create any audio track for playback
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user