Aegisub
Aegisub copied to clipboard
Fix Avisynth compilation and update headers
Main changes:
- Update build system to fix compilation on Windows with AviSynth enabled
- To fix a lot of crashes when opening various videos, use updated headers from AviSynthPlus, which are obtained from a subproject as proposed in #134
With this, Aegisub can open arbitrary .avs files, as well as many ordinary video files using DirectShowSource. Since it still crashes for some videos (and because of the other questions below), I've made this a draft for now.
The biggest annoyance in this setup is that AviSynth is now pulled twice:
- During compilation to generate the headers
- When building the installer, the DLL's for AviSynth and some of its plugins are pulled from the most recent release. This is done regardless of whether AviSynth is enabled or not.
That's also why I've pinned the version of the AviSynth headers to the current latest release for now. I'm not sure if there's any canonical better way to do this. One could also make meson compile AviSynthPlus as well as the necessary plugins, and then only bundle those with the installer if they exist. But that also feels slightly weird to do for an optional dynamically linked dependency.
There's one commit 635503a in here that I needed for this, but which is useful regardless of AviSynth. Previously, meson wouldn't pick up on default_config.json
being changed between builds (I also noticed this with #150 , for example). I added all the files listed in manifest.respack
as inputs for the target building the default config. The downside, though, is that this uses the read()
function in the fs
module, which is only available for meson >= 57.0 . I updated the minimum version, but that's another reason why this is a draft for now.
After downgrading Meson to 62.2, the CI ran through for me on Windows with AviSynth enabled: https://github.com/arch1t3cht/Aegisub/runs/7222739058?check_suite_focus=true
Just to wrap this up, I believe this is more or less complete now. I added support for compiling with Avisynth on Linux and included wangqr's fixes to the Avisynth providers, with some fixes and cleanup. Some video files still crash or freeze Aegisub, but these behave the same on other builds with Avisynth support.
Most importantly, opening video or audio from .avs files works, so it's theoretically possible to use sources like LSMASHSource via Avisynth in Aegisub if FFMS2 is causing issues again.
I'll keep other changes I make on my own fork for now, since I saw that feature additions aren't the priority right now. But since this PR was already opened, I wanted to at least add the missing parts here.