Skip to content

Commit 1f2e29c

Browse files
committed
perf: improve perf of MMNotificationClient
1 parent acdd2fe commit 1f2e29c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

SoundSwitch/Framework/NotificationManager/MMNotificationClient.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using Serilog;
1212
using SoundSwitch.Audio.Manager;
1313
using SoundSwitch.Audio.Manager.Interop.Enum;
14-
using SoundSwitch.Common.Framework.Audio.Device;
1514
using SoundSwitch.Framework.Threading;
1615
using SoundSwitch.Model;
1716
using PropertyKeys = NAudio.CoreAudioApi.PropertyKeys;
@@ -80,8 +79,7 @@ public DefaultDeviceChangedJob(MMNotificationClient notificationClient, string d
8079

8180
public Task ExecuteAsync(CancellationToken cancellationToken)
8281
{
83-
var mmDevice = AudioSwitcher.Instance.GetDevice(_deviceId);
84-
var device = AudioSwitcher.Instance.InteractWithMmDevice(mmDevice, device => new DeviceFullInfo(device));
82+
var device = AudioSwitcher.Instance.GetAudioEndpoint(_deviceId);
8583
_notificationClient.DefaultDeviceChanged?.Invoke(_notificationClient, new DeviceDefaultChangedEvent(device, _role, cancellationToken));
8684
return Task.CompletedTask;
8785
}

0 commit comments

Comments
 (0)