[vlc-devel] [PATCH 1/2] audio_output/winstore: fix free of the default device

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 24 09:16:37 CET 2020


It must be free'd with CoTaskMemFree and only once.
---
 contrib/src/gnutls/rules.mak     | 4 ++--
 modules/audio_output/Makefile.am | 8 ++++----
 modules/audio_output/winstore.c  | 3 ++-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/contrib/src/gnutls/rules.mak b/contrib/src/gnutls/rules.mak
index ae2b07afd0d..338d804a995 100644
--- a/contrib/src/gnutls/rules.mak
+++ b/contrib/src/gnutls/rules.mak
@@ -80,7 +80,7 @@ ifdef HAVE_NACL
 endif
 
 .gnutls: gnutls
-	cd $< && $(GNUTLS_ENV) ./configure $(GNUTLS_CONF)
-	cd $< && $(MAKE) -C gl install
+	# cd $< && $(GNUTLS_ENV) ./configure $(GNUTLS_CONF)
+	cd $< && $(MAKE) -C gl install V=1
 	cd $< && $(MAKE) -C lib install
 	touch $@
diff --git a/modules/audio_output/Makefile.am b/modules/audio_output/Makefile.am
index b64659e6c9e..09644612200 100644
--- a/modules/audio_output/Makefile.am
+++ b/modules/audio_output/Makefile.am
@@ -67,11 +67,11 @@ libwasapi_plugin_la_SOURCES = audio_output/wasapi.c
 libwasapi_plugin_la_LIBADD = $(LIBCOM) -lksuser
 if HAVE_WASAPI
 aout_LTLIBRARIES += libwasapi_plugin.la
-if !HAVE_WINSTORE
-aout_LTLIBRARIES += libmmdevice_plugin.la
-else
+# if !HAVE_WINSTORE
+# aout_LTLIBRARIES += libmmdevice_plugin.la
+# else
 aout_LTLIBRARIES += libwinstore_plugin.la
-endif
+# endif
 endif
 
 libdirectsound_plugin_la_SOURCES = audio_output/directsound.c \
diff --git a/modules/audio_output/winstore.c b/modules/audio_output/winstore.c
index 021be7567fc..07c4422f410 100644
--- a/modules/audio_output/winstore.c
+++ b/modules/audio_output/winstore.c
@@ -566,7 +566,8 @@ static void Close(vlc_object_t *obj)
     assert(sys->refs == 0);
 
     free(sys->acquired_device);
-    free(sys->requested_device);
+    if (sys->requested_device != sys->default_device)
+        free(sys->requested_device);
     CoTaskMemFree(sys->default_device);
     DeleteCriticalSection(&sys->lock);
 
-- 
2.26.2



More information about the vlc-devel mailing list