Commit 20fe385
fix: fix active output device detection logic
The condition for checking if an active output device exists was
incomplete. Previously, it only checked if the default sink interface
existed and its name didn't start with "auto_null" or contain "bluez".
However, it didn't verify that the name was non-empty, which could lead
to false positives when the name is empty.
Added an additional check `!m_defaultSinkInter->name().isEmpty()` to
ensure the device name is not empty before considering it as an active
output device. This prevents incorrectly identifying empty-named devices
as active output devices, which is important for proper audio device
detection and UI state management in the dock sound plugin.
Influence:
1. Test sound device detection when no physical audio devices are
connected
2. Verify dock sound plugin correctly shows/hides audio controls based
on available devices
3. Test scenarios with virtual audio devices that might have empty names
4. Verify Bluetooth audio device detection still works correctly
5. Test audio switching functionality between different output devices
fix: 修复活动输出设备检测逻辑
活动输出设备存在的检查条件不完整。之前仅检查默认输出接口是否存在且其名称
不以"auto_null"开头或不包含"bluez"。但未验证名称是否非空,这可能导致名称
为空时产生误判。
添加了额外的检查条件 `!m_defaultSinkInter->name().isEmpty()`,确保在将设
备视为活动输出设备之前,设备名称不为空。这可以防止将空名称的设备错误识别
为活动输出设备,对于dock声音插件中的音频设备检测和UI状态管理非常重要。
Influence:
1. 测试无物理音频设备连接时的声音设备检测
2. 验证dock声音插件根据可用设备正确显示/隐藏音频控制
3. 测试虚拟音频设备可能具有空名称的情况
4. 验证蓝牙音频设备检测仍正常工作
5. 测试不同输出设备之间的音频切换功能
PMS: BUG-3459451 parent 5b6db21 commit 20fe385
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| |||
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
124 | | - | |
| 129 | + | |
| 130 | + | |
125 | 131 | | |
0 commit comments