We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8120367 commit dbbc25eCopy full SHA for dbbc25e
1 file changed
audio1/audio_events.go
@@ -327,7 +327,7 @@ func (a *Audio) handleCardChanged(idx uint32) {
327
}
328
329
// 如果发生变化的是当前输出所用的声卡,且是蓝牙声卡
330
- if idx == a.defaultSink.Card && isBluetoothCard(card.core) {
+ if a.defaultSink != nil && idx == a.defaultSink.Card && isBluetoothCard(card.core) {
331
if strings.Contains(strings.ToLower(card.ActiveProfile.Name), bluezModeA2dp) {
332
a.setPropBluetoothAudioMode(bluezModeA2dp)
333
} else if strings.Contains(strings.ToLower(card.ActiveProfile.Name), bluezModeHeadset) {
0 commit comments