[vlc-devel] [PATCH] audio_output:wasapi: make sure pwf_mix is initialized when we call CoTaskMemFree()

Steve Lhomme robux4 at videolabs.io
Fri Jul 21 16:27:07 CEST 2017


---
 modules/audio_output/wasapi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index a3060c4cd4..b296f39d47 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -481,15 +481,6 @@ static HRESULT Restart(aout_stream_t *s, audio_sample_format_t *restrict pfmt,
         return E_OUTOFMEMORY;
     sys->client = NULL;
 
-    void *pv;
-    HRESULT hr = aout_stream_Activate(s, &IID_IAudioClient, NULL, &pv);
-    if (FAILED(hr))
-    {
-        msg_Err(s, "cannot activate client (error 0x%lx)", hr);
-        goto error;
-    }
-    sys->client = pv;
-
     /* Configure audio stream */
     WAVEFORMATEXTENSIBLE_IEC61937 wf_iec61937;
     WAVEFORMATEXTENSIBLE *pwfe = &wf_iec61937.FormatExt;
@@ -500,6 +491,15 @@ static HRESULT Restart(aout_stream_t *s, audio_sample_format_t *restrict pfmt,
     bool b_spdif = AOUT_FMT_SPDIF(&fmt);
     bool b_hdmi = AOUT_FMT_HDMI(&fmt);
 
+    void *pv;
+    HRESULT hr = aout_stream_Activate(s, &IID_IAudioClient, NULL, &pv);
+    if (FAILED(hr))
+    {
+        msg_Err(s, "cannot activate client (error 0x%lx)", hr);
+        goto error;
+    }
+    sys->client = pv;
+
     if (b_spdif && !b_hdmi && fmt.i_format == VLC_CODEC_DTS && !force_dts_spdif
      && fmt.i_rate >= 48000)
     {
-- 
2.12.1



More information about the vlc-devel mailing list