[vlc-commits] qt: enable volume-save on windows for "any"

Thomas Guillem git at videolan.org
Thu Mar 1 10:28:59 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Feb 27 16:00:47 2018 +0100| [4aceb014ad4192ba8ef31e42be6ad6ac6edec27e] | committer: Thomas Guillem

qt: enable volume-save on windows for "any"

(cherry picked from commit 0d947a4c78bb3afb95147dbcc8fce0b2409f724d)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4aceb014ad4192ba8ef31e42be6ad6ac6edec27e
---

 modules/gui/qt/components/simple_preferences.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index a811714e4e..635cc274c0 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -128,7 +128,15 @@ static struct {
 static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
 {
     if (!strcmp(aout, "") || !strcmp(aout, "any"))
+#ifdef _WIN32
+        /* All Windows aouts, that can be selected automatically, handle volume
+         * saving. In case of automatic mode, we'll save the last volume for
+         * every modules. Therefore, all volumes variable we be the same and we
+         * can use the first one (mmdevice). */
+        return config_GetFloat(obj, "mmdevice-volume") * 100.f + .5f;
+#else
         return -1;
+#endif
     else
     /* Note: For hysterical raisins, this is sorted by decreasing priority
      * order (then alphabetical order). */



More information about the vlc-commits mailing list