mirror of https://github.com/odrling/Aegisub
Merge branches 'bugfixes', 'video_provider_rework' and 'avisynth' into feature
This commit is contained in:
commit
4ebdc2b82c
|
@ -143,7 +143,7 @@ jobs:
|
||||||
if: startsWith(matrix.config.os, 'ubuntu-')
|
if: startsWith(matrix.config.os, 'ubuntu-')
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev libhunspell-dev libuchardet-dev libpulse-dev libopenal-dev libjansson-dev
|
sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev libhunspell-dev libuchardet-dev libpulse-dev libopenal-dev libjansson-dev nasm
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: meson setup build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }}
|
run: meson setup build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }}
|
||||||
|
|
|
@ -70,6 +70,11 @@ std::unique_ptr<agi::AudioProvider> SelectAudioProvider(fs::path const& filename
|
||||||
Path const& path_helper,
|
Path const& path_helper,
|
||||||
BackgroundRunner *br) {
|
BackgroundRunner *br) {
|
||||||
auto preferred = OPT_GET("Audio/Provider")->GetString();
|
auto preferred = OPT_GET("Audio/Provider")->GetString();
|
||||||
|
|
||||||
|
if (!std::any_of(std::begin(providers), std::end(providers), [&](factory provider) { return provider.name == preferred; })) {
|
||||||
|
preferred = OPT_GET("Audio/Provider")->GetDefaultString();
|
||||||
|
}
|
||||||
|
|
||||||
auto sorted = GetSorted(boost::make_iterator_range(std::begin(providers), std::end(providers)), preferred);
|
auto sorted = GetSorted(boost::make_iterator_range(std::begin(providers), std::end(providers)), preferred);
|
||||||
|
|
||||||
RearrangeWithPriority(sorted, filename);
|
RearrangeWithPriority(sorted, filename);
|
||||||
|
@ -84,10 +89,13 @@ std::unique_ptr<agi::AudioProvider> SelectAudioProvider(fs::path const& filename
|
||||||
std::string err;
|
std::string err;
|
||||||
try {
|
try {
|
||||||
auto provider = factory->create(filename, br);
|
auto provider = factory->create(filename, br);
|
||||||
if (!provider) continue;
|
if (!provider) {
|
||||||
|
err = "Failed to create provider."; // Some generic error message here
|
||||||
|
} else {
|
||||||
LOG_I("audio_provider") << "Using audio provider: " << factory->name;
|
LOG_I("audio_provider") << "Using audio provider: " << factory->name;
|
||||||
return provider;
|
return provider;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (AudioDataNotFound const& ex) {
|
catch (AudioDataNotFound const& ex) {
|
||||||
found_file = true;
|
found_file = true;
|
||||||
err = ex.GetMessage();
|
err = ex.GetMessage();
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
// Allocate storage for and initialise static members
|
// Allocate storage for and initialise static members
|
||||||
namespace {
|
namespace {
|
||||||
int avs_refcount = 0;
|
int avs_refcount = 0;
|
||||||
|
bool failed = false;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HINSTANCE hLib = nullptr;
|
HINSTANCE hLib = nullptr;
|
||||||
#else
|
#else
|
||||||
|
@ -66,8 +67,8 @@ const AVS_Linkage *AVS_linkage = nullptr;
|
||||||
|
|
||||||
typedef IScriptEnvironment* __stdcall FUNC(int);
|
typedef IScriptEnvironment* __stdcall FUNC(int);
|
||||||
|
|
||||||
AviSynthWrapper::AviSynthWrapper() {
|
AviSynthWrapper::AviSynthWrapper() try {
|
||||||
if (!avs_refcount){
|
if (!avs_refcount++) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define CONCATENATE(x, y) x ## y
|
#define CONCATENATE(x, y) x ## y
|
||||||
#define _Lstr(x) CONCATENATE(L, x)
|
#define _Lstr(x) CONCATENATE(L, x)
|
||||||
|
@ -94,8 +95,6 @@ AviSynthWrapper::AviSynthWrapper() {
|
||||||
if (!env)
|
if (!env)
|
||||||
throw AvisynthError("Failed to create a new avisynth script environment. Avisynth is too old?");
|
throw AvisynthError("Failed to create a new avisynth script environment. Avisynth is too old?");
|
||||||
|
|
||||||
avs_refcount++;
|
|
||||||
|
|
||||||
AVS_linkage = env->GetAVSLinkage();
|
AVS_linkage = env->GetAVSLinkage();
|
||||||
|
|
||||||
// Set memory limit
|
// Set memory limit
|
||||||
|
@ -103,6 +102,9 @@ AviSynthWrapper::AviSynthWrapper() {
|
||||||
if (memoryMax)
|
if (memoryMax)
|
||||||
env->SetMemoryMax(memoryMax);
|
env->SetMemoryMax(memoryMax);
|
||||||
}
|
}
|
||||||
|
} catch (AvisynthError const&) {
|
||||||
|
avs_refcount--;
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
AviSynthWrapper::~AviSynthWrapper() {
|
AviSynthWrapper::~AviSynthWrapper() {
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
"Next Line on Commit" : true,
|
"Next Line on Commit" : true,
|
||||||
"Player" : "",
|
"Player" : "",
|
||||||
"Plays When Stepping Video" : false,
|
"Plays When Stepping Video" : false,
|
||||||
"Provider" : "ffmpegsource",
|
"Provider" : "FFmpegSource",
|
||||||
"Renderer" : {
|
"Renderer" : {
|
||||||
"Spectrum" : {
|
"Spectrum" : {
|
||||||
"Cutoff" : 0,
|
"Cutoff" : 0,
|
||||||
|
@ -661,7 +661,7 @@
|
||||||
"Last Script Resolution Mismatch Choice" : 2,
|
"Last Script Resolution Mismatch Choice" : 2,
|
||||||
"Open Audio" : true,
|
"Open Audio" : true,
|
||||||
"Overscan Mask" : false,
|
"Overscan Mask" : false,
|
||||||
"Provider" : "ffmpegsource",
|
"Provider" : "FFmpegSource",
|
||||||
"Script Resolution Mismatch" : 1,
|
"Script Resolution Mismatch" : 1,
|
||||||
"Slider" : {
|
"Slider" : {
|
||||||
"Fast Jump Step" : 10,
|
"Fast Jump Step" : 10,
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
"Next Line on Commit" : true,
|
"Next Line on Commit" : true,
|
||||||
"Player" : "",
|
"Player" : "",
|
||||||
"Plays When Stepping Video" : false,
|
"Plays When Stepping Video" : false,
|
||||||
"Provider" : "ffmpegsource",
|
"Provider" : "FFmpegSource",
|
||||||
"Renderer" : {
|
"Renderer" : {
|
||||||
"Spectrum" : {
|
"Spectrum" : {
|
||||||
"Cutoff" : 0,
|
"Cutoff" : 0,
|
||||||
|
@ -661,7 +661,7 @@
|
||||||
"Last Script Resolution Mismatch Choice" : 2,
|
"Last Script Resolution Mismatch Choice" : 2,
|
||||||
"Open Audio" : true,
|
"Open Audio" : true,
|
||||||
"Overscan Mask" : false,
|
"Overscan Mask" : false,
|
||||||
"Provider" : "ffmpegsource",
|
"Provider" : "FFmpegSource",
|
||||||
"Script Resolution Mismatch" : 1,
|
"Script Resolution Mismatch" : 1,
|
||||||
"Slider" : {
|
"Slider" : {
|
||||||
"Fast Jump Step" : 10,
|
"Fast Jump Step" : 10,
|
||||||
|
|
|
@ -69,6 +69,11 @@ std::vector<std::string> VideoProviderFactory::GetClasses() {
|
||||||
|
|
||||||
std::unique_ptr<VideoProvider> VideoProviderFactory::GetProvider(agi::fs::path const& filename, std::string const& colormatrix, agi::BackgroundRunner *br) {
|
std::unique_ptr<VideoProvider> VideoProviderFactory::GetProvider(agi::fs::path const& filename, std::string const& colormatrix, agi::BackgroundRunner *br) {
|
||||||
auto preferred = OPT_GET("Video/Provider")->GetString();
|
auto preferred = OPT_GET("Video/Provider")->GetString();
|
||||||
|
|
||||||
|
if (!std::any_of(std::begin(providers), std::end(providers), [&](factory provider) { return provider.name == preferred; })) {
|
||||||
|
preferred = OPT_GET("Audio/Provider")->GetDefaultString();
|
||||||
|
}
|
||||||
|
|
||||||
auto sorted = GetSorted(boost::make_iterator_range(std::begin(providers), std::end(providers)), preferred);
|
auto sorted = GetSorted(boost::make_iterator_range(std::begin(providers), std::end(providers)), preferred);
|
||||||
|
|
||||||
RearrangeWithPriority(sorted, filename);
|
RearrangeWithPriority(sorted, filename);
|
||||||
|
@ -89,10 +94,13 @@ std::unique_ptr<VideoProvider> VideoProviderFactory::GetProvider(agi::fs::path c
|
||||||
std::string err;
|
std::string err;
|
||||||
try {
|
try {
|
||||||
auto provider = factory->create(filename, colormatrix, br);
|
auto provider = factory->create(filename, colormatrix, br);
|
||||||
if (!provider) continue;
|
if (!provider) {
|
||||||
|
err = "Failed to create provider."; // Some generic error message here
|
||||||
|
} else {
|
||||||
LOG_I("manager/video/provider") << factory->name << ": opened " << filename;
|
LOG_I("manager/video/provider") << factory->name << ": opened " << filename;
|
||||||
return finalize_provider(std::move(provider));
|
return finalize_provider(std::move(provider));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (VideoNotSupported const& ex) {
|
catch (VideoNotSupported const& ex) {
|
||||||
found = true;
|
found = true;
|
||||||
err = "video is not in a supported format: " + ex.GetMessage();
|
err = "video is not in a supported format: " + ex.GetMessage();
|
||||||
|
|
|
@ -105,5 +105,14 @@ echo
|
||||||
echo "---- Fixing libraries ----"
|
echo "---- Fixing libraries ----"
|
||||||
sudo python3 "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $?
|
sudo python3 "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $?
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "---- Resigning ----"
|
||||||
|
# After bundling and rewriting dylib paths we need to resign everything.
|
||||||
|
if codesign -d "${PKG_DIR}/Contents/MacOS/aegisub"; then
|
||||||
|
for fname in "${PKG_DIR}/Contents/MacOS/"*; do
|
||||||
|
codesign -s ${AEGISUB_BUNDLE_SIGNATURE:--} -vf "${fname}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Done creating \"${PKG_DIR}\""
|
echo "Done creating \"${PKG_DIR}\""
|
||||||
|
|
Loading…
Reference in New Issue