Skip to content

Commit

Permalink
Merge branch 'Aleksoid1978:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackjjang authored Feb 22, 2024
2 parents b56b848 + ef23fb1 commit f58180a
Show file tree
Hide file tree
Showing 399 changed files with 9,712 additions and 5,201 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build MPC-BE

on:
push:
paths-ignore:
- .github/workflows/main.yml
- docs/**
- LICENSE.txt
- src/apps/mpcresources/text/**
- '**.vcxproj.filters'
pull_request:
paths-ignore:
- .github/workflows/main.yml
- docs/**
- LICENSE.txt
- src/apps/mpcresources/text/**
- '**.vcxproj.filters'

jobs:
build:
runs-on: windows-latest
timeout-minutes: 60

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Prepare MSYS
run: |
curl -sSL https://github.com/Aleksoid1978/MSYS/raw/main/MSYS_MinGW-w64_GCC_1320_x86-x64.7z -o MSYS.7z
7z x MSYS.7z -oC:\\MSYS
echo '@ECHO OFF' > environments.bat
echo 'SET "MPCBE_MSYS=C:\\MSYS"' >> environments.bat
echo 'SET "MPCBE_MINGW=C:\\MSYS\\mingw"' >> environments.bat
.\\update_gcc.bat
shell: pwsh

- name: Clean
run: |
.\\build.bat Clean All
shell: pwsh

- name: Build MPC-BE
run: |
.\\build.bat Build Packages
shell: pwsh

- name: Upload Installer x64
uses: actions/upload-artifact@v4
with:
name: "Installer x64"
path: _bin/Packages/**/MPC-BE*.x64-installer.zip
compression-level: 0

- name: Upload Zip x64
uses: actions/upload-artifact@v4
with:
name: "Zip x64"
path: _bin/Packages/**/MPC-BE*.x64.7z
compression-level: 0

- name: Upload Installer x86
uses: actions/upload-artifact@v4
with:
name: "Installer x86"
path: _bin/Packages/**/MPC-BE*.x86-installer.zip
compression-level: 0

- name: Upload Zip x86
uses: actions/upload-artifact@v4
with:
name: "Zip x86"
path: _bin/Packages/**/MPC-BE*.x86.7z
compression-level: 0
14 changes: 12 additions & 2 deletions docs/Changelog.Rus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@ MPCVideoDec
Добавлена возможность открыть папку воспроизводимого файла с помощью горячей клавиши.
Не показываем нулевые часы при отображении времени.
Немного изменена логика смещения кадра относительно центра окна.
Улучшения открытия длинных путей и путей начинающихся с "\\?\".
Исправлена работа настройки "Поверх всех окон".
Исключена возможность добавление поддерживаемых видеорендереров в список внешних фильтров. Поддерживаемые видеорендереры выбираются в панели настроек "Видео".
Различные исправления интерфейса.

Обновлен французский перевод (автор rhahgleuhargh).
Обновлен итальянский перевод (автор mapi68).
Обновлен корейский перевод (автор Hackjjang).

Обновлены библиотеки:
ffmpeg git-n6.2-dev-848-gd2eb6f4d44;
nanosvg git-93ce879.
dav1d git-1.4.0-1-g97cc6ce;
ffmpeg git-n6.2-dev-1203-gcb9f1f59a1;
Little-CMS git-lcms2.16-26-gc2a5401;
MediaInfo git-v24.01-g51dbd896;
nanosvg git-93ce879;
rapidjson git-v1.1.0-748-g3f73edae;
ZenLib git-v0.4.41-12-g26b4aa1;
zlib 1.3.1.


1.6.11 - 2023-12-27
Expand Down
14 changes: 12 additions & 2 deletions docs/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@ Player
Added the ability to open the folder of the currently playing file using a hotkey.
Do not show zero hours when displaying time.
Changed the logic of frame offset relative to the center of the window.
Improvements to opening long paths and paths starting with "\\?\".
Fixed the operation of the "On Top" setting.
The ability to add supported video renderers to the list of external filters has been removed. Supported video renderers are selected in the Video settings panel.
Various interface fixes.

Updated French translation (by rhahgleuhargh).
Updated Italian translation (by mapi68).
Updated Korean translation (by Hackjjang).

Updated libraries:
ffmpeg git-n6.2-dev-848-gd2eb6f4d44;
nanosvg git-93ce879.
dav1d git-1.4.0-1-g97cc6ce;
ffmpeg git-n6.2-dev-1203-gcb9f1f59a1;
Little-CMS git-lcms2.16-26-gc2a5401;
MediaInfo git-v24.01-g51dbd896;
nanosvg git-93ce879;
rapidjson git-v1.1.0-748-g3f73edae;
ZenLib git-v0.4.41-12-g26b4aa1;
zlib 1.3.1.


1.6.11 - 2023-12-27
Expand Down
11 changes: 7 additions & 4 deletions docs/Compilation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Visual Studio 2022
Download URL: https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes
1. Install Visual Studio 2022 (any edition will work fine). During installation, you must select the following components:
Install Visual Studio 2022 (any edition will work fine). During installation, you must select the following components:
* Desktop development with C++
* MSVC v143 - Build Tools C++
* Windows SDK 10.0.18362.0 or newer (latest).
Expand All @@ -29,9 +29,12 @@


2. Preparing the GCC environment (YASM is already included)
2.1. Download https://mpc-be.org/MSYS/MSYS_MinGW-w64_GCC_1320_x86-x64.7z
2.2. Unpack the archive to "C:\MSYS".
NOTES: If you installed the MSYS/MinGW package in an other directory you will have to use that path in the following steps.
2.1. Download https://github.com/Aleksoid1978/MSYS/raw/main/MSYS_MinGW-w64_GCC_1320_x86-x64.7z
2.2. Unpack the archive to "C:\MSYS".
Example of downloading and unpacking:
curl -sSL https://github.com/Aleksoid1978/MSYS/raw/main/MSYS_MinGW-w64_GCC_1320_x86-x64.7z -o MSYS.7z
7z x MSYS.7z -oC:\MSYS
NOTES: If you installed the MSYS/MinGW package in an other directory you will have to use that path in the following steps.


3. Additional optional components
Expand Down
41 changes: 27 additions & 14 deletions docs/Release.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
Here is a quick how-to release a new stable build:
Подсказка по выпуску релиза плеера MPC-BE:

1) Make sure you have a clean source tree, no modified files included
2) Update the revision number and the date in Changelog.txt
3) Compile MPC-BE and the standalone filters
4) Create an svn tag for the new release
5) Keep the PDB files of all the filters and MPC-BE builds
6) Upload the binary packages on SF following the directory and the packages names scheme
(you can also upload the PDB files too, use 7zip for creating the 7z packages)
7) Update the webpage with the new download links, history and version.txt with
the new version number (in the SF FTP)
1. Проверяем отсутствие изменений в локальном репозитории и синхронизируем код с сервером.
git pull
git submodule update --init --recursive

2. Обновляем Changelog.Rus.txt и Changelog.txt. Записываем номер версии релиза и текущую дату.

In the next commit, bump the version:
3. Обновляем номер версии в "include/Version.h" и меняем MPC_VERSION_STATUS на 1.

1) In "include/Version.h"
2) In "src/mplayerc/res/mpc-be.exe.manifest.conf" and
"src/mplayerc/res/mpc-be.exe.manifest.template"
4. Обновляем номер версии в "src/mplayerc/res/mpc-be.exe.manifest.conf" и "src/mplayerc/res/mpc-be.exe.manifest.template"

5. Очищаем папку "_bin" и делаем пробную сборку.
build.bat Build All Packages

6. Если все хорошо, то создаем коммит "Релиз x.x.x.".

7. Создаем новую метку с номером версии релиза и пишем для метки сообщение "Релиз x.x.x.".

8. Заливаем изменения на сервер, включая новую метку.

9. Очищаем папку "_bin" и делаем сборку релиза.
build.bat Build All Packages

10. Создаем файл контрольных сумм mpc-be.x.x.x.checksums.sha для всех файлов релиза из папки "Packages\x.x.x".

11. На странице https://github.com/Aleksoid1978/MPC-BE/releases создаем новый релиз. Прописываем изменения. Добавляем файлы релиза и файл контрольных сумм. Публикуем релиз.

12. Прописываем новую версию и путь в файл version.txt на сервере mpc-be.org, чтобы проверка обновлений сообщала о новой версии.

13. Делаем копию релизных файлов по адресу https://sourceforge.net/projects/mpcbe/files/MPC-BE/Release%20builds/ и указываем инсталлятор версии x64 по умолчанию для скачивания.
4 changes: 3 additions & 1 deletion docs/custom_code/ffmpeg.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
* libavcodec/x86/hevcdsp.h
* libavcodec/x86/hevcdsp_init.c

* libavcodec/vvc/vvcdec.c

* libavcodec/aacsbr_template.c
* libavcodec/bsf_list.c
* libavcodec/codec_list.c
* libavcodec/d3d12va_vc1.c
* libavcodec/d3d12va_hevc.c
* libavcodec/dxva2.c
* libavcodec/dxva2_hevc.c
* libavcodec/dxva2_internal.h
Expand Down
Binary file modified lib/libdav1d.a
Binary file not shown.
Binary file modified lib64/libdav1d.a
Binary file not shown.
2 changes: 2 additions & 0 deletions src/DSUtil/HTTPAsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ HRESULT CHTTPAsync::ReadInternal(PBYTE pBuffer, DWORD dwSizeToRead, DWORD& dwSiz

HRESULT CHTTPAsync::Read(PBYTE pBuffer, DWORD dwSizeToRead, DWORD& dwSizeRead, DWORD dwTimeOut/* = INFINITE*/)
{
dwSizeRead = 0;

if (m_http_chunk.use) {
HRESULT hr = S_OK;
auto begin = pBuffer;
Expand Down
122 changes: 95 additions & 27 deletions src/DSUtil/Profile.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) 2018-2023 see Authors.txt
* (C) 2018-2024 see Authors.txt
*
* This file is part of MPC-BE.
*
Expand All @@ -26,6 +26,7 @@
#include "CryptoUtils.h"
#include "Log.h"
#include "Profile.h"
#include "text.h"

CStringW GetIniProgramDir()
{
Expand Down Expand Up @@ -848,48 +849,40 @@ void CProfile::EnumValueNames(const wchar_t* section, std::vector<CStringW>& val
if (m_hAppRegKey) {
CRegKey regkey;
if (ERROR_SUCCESS == regkey.Open(m_hAppRegKey, section, KEY_READ)) {
// https://docs.microsoft.com/ru-ru/windows/desktop/SysInfo/enumerating-registry-subkeys
WCHAR achClass[MAX_PATH] = L"";
DWORD cchClassName = MAX_PATH;
DWORD cSubKeys = 0;
DWORD cbMaxSubKey;
DWORD cchMaxClass;
DWORD cValues;
DWORD cchMaxValue;
DWORD cbMaxValueData;
DWORD cbSecurityDescriptor;
FILETIME ftLastWriteTime;
DWORD cValues = 0;
DWORD cchMaxValue = 0;

// Get the class name and the value count.
DWORD retCode = RegQueryInfoKeyW(
regkey.m_hKey,
achClass,
&cchClassName,
nullptr,
&cSubKeys,
&cbMaxSubKey,
&cchMaxClass,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
&cValues,
&cchMaxValue,
&cbMaxValueData,
&cbSecurityDescriptor,
&ftLastWriteTime);
nullptr,
nullptr,
nullptr);

if (ERROR_SUCCESS == retCode && cValues) {
WCHAR achValue[16383];
if (ERROR_SUCCESS == retCode && cValues && cchMaxValue) {
std::vector<WCHAR> achValue(cchMaxValue + 1, '\0');

for (DWORD i = 0, retCode = ERROR_SUCCESS; i < cValues; i++) {
DWORD cchValue = std::size(achValue);
DWORD cchValue = cchMaxValue + 1;
achValue[0] = '\0';
retCode = RegEnumValueW(regkey.m_hKey, i, achValue, &cchValue, NULL, NULL, NULL, NULL);
retCode = RegEnumValueW(regkey.m_hKey, i, achValue.data(), &cchValue, NULL, NULL, NULL, NULL);
if (retCode == ERROR_SUCCESS) {
valuenames.emplace_back(achValue, cchValue);
valuenames.emplace_back(achValue.data(), cchValue);
}
}
}
regkey.Close();
}
} else {
}
else {
InitIni();
auto it1 = m_ProfileMap.find(section);
if (it1 != m_ProfileMap.end()) {
Expand All @@ -901,6 +894,67 @@ void CProfile::EnumValueNames(const wchar_t* section, std::vector<CStringW>& val
}
}

void CProfile::EnumSectionNames(const wchar_t* section, std::vector<CStringW>& sectionnames)
{
std::lock_guard<std::recursive_mutex> lock(m_Mutex);

sectionnames.clear();

if (m_hAppRegKey) {
CRegKey regkey;
if (ERROR_SUCCESS == regkey.Open(m_hAppRegKey, section, KEY_READ)) {
DWORD cSubKeys = 0;
DWORD cbMaxSubKey = 0;

// Get the class name and the value count.
DWORD retCode = RegQueryInfoKeyW(
regkey.m_hKey,
nullptr,
nullptr,
nullptr,
&cSubKeys,
&cbMaxSubKey,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr);

if (ERROR_SUCCESS == retCode && cSubKeys && cbMaxSubKey) {
std::vector<WCHAR> achKey(cbMaxSubKey + 1, '\0');

for (DWORD i = 0; i < cSubKeys; i++) {
DWORD cbName = cbMaxSubKey + 1;
achKey[0] = '\0';
retCode = RegEnumKeyExW(regkey.m_hKey, i, achKey.data(), &cbName, nullptr, nullptr, nullptr, nullptr);
if (retCode == ERROR_SUCCESS) {
sectionnames.emplace_back(achKey.data(), cbName);
}
}
}
regkey.Close();
}
}
else {
InitIni();
CStringW prefix(section);
prefix += L'\\';

auto it = m_ProfileMap.cbegin();
while (it != m_ProfileMap.cend() && !StartsWith(it->first, prefix)) {
++it;
}

while (it != m_ProfileMap.cend() && StartsWith(it->first, prefix)) {
if (it->first.GetLength() > prefix.GetLength()) {
sectionnames.emplace_back(it->first.Mid(prefix.GetLength()));
}
++it;
}
}
}

bool CProfile::DeleteValue(const wchar_t* section, const wchar_t* entry)
{
std::lock_guard<std::recursive_mutex> lock(m_Mutex);
Expand Down Expand Up @@ -948,7 +1002,21 @@ bool CProfile::DeleteSection(const wchar_t* section)
}
else {
InitIni();
if (m_ProfileMap.erase(section)) {
const CStringW mainsection(section);
const CStringW prefix(mainsection + L'\\');

auto start = m_ProfileMap.cbegin();
while (start != m_ProfileMap.cend() && start->first != mainsection && !StartsWith(start->first, prefix)) {
++start;
}

if (start != m_ProfileMap.cend()) {
auto end = std::next(start);
while (end != m_ProfileMap.cend() && StartsWith(end->first, prefix)) {
++end;
}

m_ProfileMap.erase(start, end);
m_bIniNeedFlush = true;
ret = true;
}
Expand Down
Loading

0 comments on commit f58180a

Please sign in to comment.