(Android Phoenix) Add ability to set automatic audio latency option on/off

This commit is contained in:
twinaphex 2013-09-13 15:17:09 +02:00
parent 9a2a7854ea
commit e6f527e992
2 changed files with 8 additions and 1 deletions

View File

@ -120,6 +120,12 @@
android:summary="Use (very) high latency audio. Necessary for older Android devices with poor audio drivers."
android:title="High latency audio"
android:dependency="audio_enable" />
<CheckBoxPreference
android:defaultValue="true"
android:key="audio_latency_auto"
android:summary="Use automatic audio latency detection. Only available for Android 4.1 and up - your mileage may vary based on the device you are using."
android:title="Automatic audio latency"
android:dependency="audio_enable" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen android:title="Input Options" >

View File

@ -359,7 +359,8 @@ public class MainMenuActivity extends PreferenceActivity {
config.setInt("audio_out_rate", optimalRate);
// Refactor this entire mess and make this usable for per-core config
if (android.os.Build.VERSION.SDK_INT >= 17) {
if (android.os.Build.VERSION.SDK_INT >= 17 &&
prefs.getBoolean("audio_latency_auto", true) == true) {
int buffersize = getLowLatencyBufferSize();
boolean lowLatency = hasLowLatencyAudio();