aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2020-07-03 19:16:42 +1200
committerMatthew Gregan <[email protected]>2020-07-03 19:16:42 +1200
commit0bd0338c9a00af94363f278c193b56991210559c (patch)
tree967bdefdf73c983e446dd3b17fd767362b797764
parent575bd443893638da4a88468576e4e10b706c7a6c (diff)
parentb69886c0bf083a008e28c193560fafec38d7c267 (diff)
downloadcubeb-0bd0338c9a00af94363f278c193b56991210559c.tar.gz
cubeb-0bd0338c9a00af94363f278c193b56991210559c.zip
Merge branch 'patch-1' of https://github.com/Filoppi/cubeb into Filoppi-patch-1
-rw-r--r--src/cubeb_wasapi.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp
index 4b5925f..932111f 100644
--- a/src/cubeb_wasapi.cpp
+++ b/src/cubeb_wasapi.cpp
@@ -1777,10 +1777,11 @@ handle_channel_layout(cubeb_stream * stm, EDataFlow direction, com_heap_ptr<WAV
waveformatex_update_derived_properties(mix_format.get());
/* Check if wasapi will accept our channel layout request. */
- WAVEFORMATEX * closest;
+ WAVEFORMATEX * tmp = nullptr;
HRESULT hr = audio_client->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED,
mix_format.get(),
- &closest);
+ &tmp);
+ com_heap_ptr<WAVEFORMATEX> closest(tmp);
if (hr == S_FALSE) {
/* Channel layout not supported, but WASAPI gives us a suggestion. Use it,
and handle the eventual upmix/downmix ourselves. Ignore the subformat of