opt: aaudio (#1805)

* opt: aaudio
This commit is contained in:
My-Responsitories
2026-01-18 09:29:34 +08:00
committed by GitHub
parent 2879d0dc00
commit 25148509d2
3 changed files with 4 additions and 6 deletions

View File

@@ -321,9 +321,9 @@ List<SettingsModel> get videoSettings => [
const SwitchModel( const SwitchModel(
title: '优先使用 OpenSL ES 输出音频', title: '优先使用 OpenSL ES 输出音频',
leading: Icon(Icons.speaker_outlined), leading: Icon(Icons.speaker_outlined),
subtitle: '关闭则优先使用AudioTrack输出音频此项即mpv的--ao若遇系统音效丢失、无声、音画不同步等问题请尝试关闭', subtitle: '关闭则优先使用AAudio输出音频此项即mpv的--ao若遇系统音效丢失、无声、音画不同步等问题请尝试打开',
setKey: SettingBoxKey.useOpenSLES, setKey: SettingBoxKey.useOpenSLES,
defaultVal: true, defaultVal: false,
), ),
const SwitchModel( const SwitchModel(
title: '扩大缓冲区', title: '扩大缓冲区',

View File

@@ -797,9 +797,7 @@ class PlPlayerController {
await pp.setProperty("af", "scaletempo2=max-speed=8"); await pp.setProperty("af", "scaletempo2=max-speed=8");
if (Platform.isAndroid) { if (Platform.isAndroid) {
await pp.setProperty("volume-max", "100"); await pp.setProperty("volume-max", "100");
String ao = Pref.useOpenSLES final ao = Pref.useOpenSLES ? "opensles,aaudio" : "aaudio,opensles";
? "opensles,audiotrack"
: "audiotrack,opensles";
await pp.setProperty("ao", ao); await pp.setProperty("ao", ao);
} }
// video-sync=display-resample // video-sync=display-resample

View File

@@ -783,7 +783,7 @@ abstract final class Pref {
_setting.get(SettingBoxKey.expandBuffer, defaultValue: false); _setting.get(SettingBoxKey.expandBuffer, defaultValue: false);
static bool get useOpenSLES => static bool get useOpenSLES =>
_setting.get(SettingBoxKey.useOpenSLES, defaultValue: true); _setting.get(SettingBoxKey.useOpenSLES, defaultValue: false);
static bool get enableAi => static bool get enableAi =>
_setting.get(SettingBoxKey.enableAi, defaultValue: false); _setting.get(SettingBoxKey.enableAi, defaultValue: false);