[vlc-devel] [PATCH v2 2/4] aout: winstore: handle the "volume-save"
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jun 26 11:34:49 CEST 2020
---
modules/audio_output/winstore.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/modules/audio_output/winstore.c b/modules/audio_output/winstore.c
index ac225fd84c8..f108b577ebe 100644
--- a/modules/audio_output/winstore.c
+++ b/modules/audio_output/winstore.c
@@ -212,7 +212,9 @@ static int aout_stream_Start(void *func, bool forced, va_list ap)
HRESULT *hr = va_arg(ap, HRESULT *);
(void) forced;
- *hr = start(s, fmt, &GUID_VLC_AUD_OUT);
+ LPCGUID guid = var_GetBool(s, "volume-save") ? &GUID_VLC_AUD_OUT : NULL;
+
+ *hr = start(s, fmt, guid);
return SUCCEEDED(*hr) ? VLC_SUCCESS : VLC_EGENERIC;
}
@@ -283,6 +285,9 @@ static int Open(vlc_object_t *obj)
if (unlikely(sys == NULL))
return VLC_ENOMEM;
+ if (!var_CreateGetBool(aout, "volume-save"))
+ VolumeSet(aout, var_InheritFloat(aout, "mmdevice-volume"));
+
aout->sys = sys;
sys->stream = NULL;
sys->client = var_CreateGetAddress( vlc_object_parent(aout), "winstore-client" );
@@ -308,6 +313,9 @@ static void Close(vlc_object_t *obj)
free(sys);
}
+#define VOLUME_TEXT N_("Audio volume")
+#define VOLUME_LONGTEXT N_("Audio volume in hundredths of decibels (dB).")
+
vlc_module_begin()
set_shortname("winstore")
set_description("Windows Store audio output")
@@ -316,4 +324,6 @@ vlc_module_begin()
set_subcategory(SUBCAT_AUDIO_AOUT)
add_shortcut("wasapi")
set_callbacks(Open, Close)
+ add_float("mmdevice-volume", 1.f, VOLUME_TEXT, VOLUME_LONGTEXT, true)
+ change_float_range( 0.f, 1.25f )
vlc_module_end()
--
2.26.2
More information about the vlc-devel
mailing list