Commit 8c3dd42
committed
fix: fix audio resume logic for default sink/source
The previous logic had a bug where resumeSinkConfig and
resumeSourceConfig would only be called if autoSwitchOutputPort or
autoSwitchInputPort returned false. This could cause issues when a
default sink or source already exists (non-nil) but auto-switching
succeeded. The fix ensures that resume config is also called when a
default sink or source is already present, regardless of the auto-
switch result. This prevents potential audio configuration issues after
initialization.
Influence:
1. Test audio initialization with existing default sink and source
2. Verify audio output resumes correctly after system startup
3. Test audio input configuration persistence
4. Verify behavior when auto-switching succeeds but default devices
exist
5. Test audio functionality after suspend/resume cycles
fix: 修复默认音频输入输出设备的恢复逻辑
之前的逻辑存在一个缺陷,只有当自动切换输出端口或输入端口返回 false 时,
才会调用 resumeSinkConfig 和 resumeSourceConfig。这可能导致当默认音频输
出或输入设备已经存在(非空)但自动切换成功时出现问题。修复确保当默认音频
输出或输入设备已经存在时,无论自动切换结果如何,都会调用恢复配置。这可以
防止初始化后可能出现的音频配置问题。
Influence:
1. 测试存在默认音频输出和输入设备时的音频初始化
2. 验证系统启动后音频输出是否正确恢复
3. 测试音频输入配置的持久性
4. 验证当自动切换成功但默认设备存在时的行为
5. 测试系统休眠唤醒后的音频功能
PMS: BUG-3497191 parent 110fc6f commit 8c3dd42
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
816 | | - | |
| 816 | + | |
817 | 817 | | |
818 | 818 | | |
819 | | - | |
820 | | - | |
| 819 | + | |
821 | 820 | | |
822 | 821 | | |
823 | 822 | | |
| |||
0 commit comments