Skip to content

Commit caf69e2

Browse files
wasapi: Remove redundant format checks
1 parent 961323e commit caf69e2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/host/wasapi/device.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ pub unsafe fn is_format_supported(
195195
client: &Audio::IAudioClient,
196196
waveformatex_ptr: *const Audio::WAVEFORMATEX,
197197
) -> Result<bool, SupportedStreamConfigsError> {
198-
// Check if the given format is supported.
198+
// Checking formats is not needed for shared mode with auto-conversion, therefore this check has been removed until someone implements WASAPI exclusive mode support
199+
// I used an NAudio issue as reference: https://github.com/naudio/NAudio/issues/819
200+
/* // Check if the given format is supported.
199201
let mut closest_waveformatex_ptr: *mut Audio::WAVEFORMATEX = ptr::null_mut();
200202
201203
let result = client.IsFormatSupported(
@@ -215,7 +217,9 @@ pub unsafe fn is_format_supported(
215217
r if r.is_err() => Ok(false),
216218
Foundation::S_FALSE => Ok(false),
217219
_ => Ok(true),
218-
}
220+
}*/
221+
222+
Ok(true)
219223
}
220224

221225
// Get a cpal Format from a WAVEFORMATEX.

0 commit comments

Comments
 (0)