diff --git a/src/DSUtil/Profile.cpp b/src/DSUtil/Profile.cpp index cf5a1fccfa..5c24bbc487 100644 --- a/src/DSUtil/Profile.cpp +++ b/src/DSUtil/Profile.cpp @@ -94,14 +94,14 @@ void CProfile::InitIni() } // Don't reread mpc-be.ini if the cache needs to be flushed or it was accessed recently - const DWORD tick = GetTickCount(); - if (m_bIniFirstInit && (m_bIniNeedFlush || tick - m_dwIniLastAccessTick < 100)) { - m_dwIniLastAccessTick = tick; + const ULONGLONG tick = GetTickCount64(); + if (m_bIniFirstInit && (m_bIniNeedFlush || tick - m_IniLastAccessTick < 100u)) { + m_IniLastAccessTick = tick; return; } m_bIniFirstInit = true; - m_dwIniLastAccessTick = tick; + m_IniLastAccessTick = tick; if (!::PathFileExistsW(m_IniPath)) { return; @@ -171,7 +171,7 @@ void CProfile::InitIni() fpStatus = fclose(fp); ASSERT(fpStatus == 0); - m_dwIniLastAccessTick = GetTickCount(); // update the last access tick because reading the file can take a long time + m_IniLastAccessTick = GetTickCount64(); // update the last access tick because reading the file can take a long time } bool CProfile::StoreSettingsTo(const SettingsLocation newLocation) diff --git a/src/DSUtil/Profile.h b/src/DSUtil/Profile.h index 60f3ed22d7..cc705c65c2 100644 --- a/src/DSUtil/Profile.h +++ b/src/DSUtil/Profile.h @@ -49,7 +49,7 @@ class CProfile std::map, KeyCmp> m_ProfileMap; bool m_bIniFirstInit = false; bool m_bIniNeedFlush = false; - DWORD m_dwIniLastAccessTick = 0; + ULONGLONG m_IniLastAccessTick = 0; public: CProfile(); diff --git a/src/apps/mplayerc/HistoryFile.cpp b/src/apps/mplayerc/HistoryFile.cpp index 60380cdf36..188cac15f1 100644 --- a/src/apps/mplayerc/HistoryFile.cpp +++ b/src/apps/mplayerc/HistoryFile.cpp @@ -1,5 +1,5 @@ /* - * (C) 2021-2023 see Authors.txt + * (C) 2021-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -33,8 +33,8 @@ FILE* CMpcLstFile::CheckOpenFileForRead(bool& valid) return nullptr; } - const DWORD tick = GetTickCount(); - if (m_LastAccessTick && std::labs(tick - m_LastAccessTick) < 100) { + const ULONGLONG tick = GetTickCount64(); + if (m_LastAccessTick && tick - m_LastAccessTick < 100u) { valid = true; return nullptr; } @@ -74,7 +74,7 @@ void CMpcLstFile::CloseFile(FILE*& pFile) { int fpStatus = fclose(pFile); ASSERT(fpStatus == 0); - m_LastAccessTick = GetTickCount(); + m_LastAccessTick = GetTickCount64(); pFile = nullptr; } diff --git a/src/apps/mplayerc/HistoryFile.h b/src/apps/mplayerc/HistoryFile.h index b05844a858..794b9aeabe 100644 --- a/src/apps/mplayerc/HistoryFile.h +++ b/src/apps/mplayerc/HistoryFile.h @@ -1,5 +1,5 @@ /* - * (C) 2021-2023 see Authors.txt + * (C) 2021-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -74,7 +74,7 @@ struct SessionInfo { class CMpcLstFile { private: - DWORD m_LastAccessTick = 0; + ULONGLONG m_LastAccessTick = 0; protected: std::mutex m_Mutex; diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp index 0170b2fe9e..7b4e4b8168 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.cpp +++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp @@ -755,7 +755,7 @@ POSITION CPlaylist::Shuffle() } } - std::shuffle(a.begin(), a.end(), std::default_random_engine((unsigned)GetTickCount())); + std::shuffle(a.begin(), a.end(), std::default_random_engine((unsigned)GetTickCount64())); } return a[idx++];