[vlc-commits] wasapi: add var_SetWide() helper
Rémi Denis-Courmont
git at videolan.org
Mon Jul 23 20:27:24 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 23 20:53:02 2012 +0300| [7dc7f6133ff42df8b3c4212d15e38e66996f4901] | committer: Rémi Denis-Courmont
wasapi: add var_SetWide() helper
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7dc7f6133ff42df8b3c4212d15e38e66996f4901
---
modules/audio_output/wasapi.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index 00d755b..da64d09 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -292,6 +292,18 @@ static wchar_t *var_InheritWide(vlc_object_t *obj, const char *name)
}
#define var_InheritWide(o,n) var_InheritWide(VLC_OBJECT(o),n)
+static int var_SetWide(vlc_object_t *obj, const char *name, const wchar_t *val)
+{
+ char *str = FromWide(val);
+ if (unlikely(str == NULL))
+ return VLC_ENOMEM;
+
+ int ret = var_SetString(obj, name, str);
+ free(str);
+ return ret;
+}
+#define var_SetWide(o,n,v) var_SetWide(VLC_OBJECT(o),n,v)
+
/* Dummy thread to create and release COM interfaces when needed. */
static void MTAThread(void *data)
{
More information about the vlc-commits
mailing list