Fix Initial volume always being 50

- Fixed current volume not being save to settings.ini causing initial volume to always be 50.
[Issue: https://github.com/Zaarrg/stremio-desktop-v5/issues/42]
This commit is contained in:
Zarg 2025-02-04 04:35:27 +01:00
parent b159fd01e8
commit 33dc1e942f
3 changed files with 6 additions and 0 deletions

View file

@ -53,6 +53,7 @@ void SaveSettings()
WritePrivateProfileStringW(L"General", L"PauseOnMinimize", pauseMinVal, iniPath.c_str());
WritePrivateProfileStringW(L"General", L"PauseOnLostFocus", pauseFocVal, iniPath.c_str());
WritePrivateProfileStringW(L"General", L"AllowZoom", allowZoomVal, iniPath.c_str());
WriteIntToIni(L"MPV", L"InitialVolume", g_currentVolume, iniPath);
}
static void WriteIntToIni(const std::wstring &section, const std::wstring &key, int value, const std::wstring &iniPath)

View file

@ -5,4 +5,5 @@ void LoadSettings();
void SaveSettings();
void SaveWindowPlacement(const WINDOWPLACEMENT &wp);
bool LoadWindowPlacement(WINDOWPLACEMENT &wp);
static void WriteIntToIni(const std::wstring &section, const std::wstring &key, int value, const std::wstring &iniPath);
#endif // CONFIG_H

View file

@ -10,6 +10,8 @@
#include <gdiplus.h>
#include <sstream>
#include "config.h"
static std::wstring GetDailyCrashLogPath()
{
std::time_t t = std::time(nullptr);
@ -49,6 +51,8 @@ void AppendToCrashLog(const std::string& message)
void Cleanup()
{
//Save Settings
SaveSettings();
// Shut down mpv
CleanupMPV();
// Shut down Node