sysaudio: fix crash on windows without a mic/capture device
This commit is contained in:
parent
f080a1c31e
commit
73a1ea4650
1 changed files with 3 additions and 1 deletions
|
|
@ -162,7 +162,9 @@ pub const Context = struct {
|
|||
const default_playback_id = try ctx.getDefaultAudioEndpoint(.playback);
|
||||
defer ctx.allocator.free(default_playback_id.?);
|
||||
const default_capture_id = try ctx.getDefaultAudioEndpoint(.capture);
|
||||
defer ctx.allocator.free(default_capture_id.?);
|
||||
if (default_capture_id) |default_id| {
|
||||
defer ctx.allocator.free(default_id);
|
||||
}
|
||||
|
||||
// enumerate
|
||||
var collection: ?*win32.IMMDeviceCollection = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue