vapoursynth: Improve lsmas plugin version detection

Some lsmas versions (like HomeOfAviSynthPlusEvolution's, the currently
actively maintained one) support the "cachedir" argument but do not
have a "Version" function. Hence, it's better to just check for the
argument directly.
This commit is contained in:
arch1t3cht 2024-07-16 16:22:33 +02:00
parent 9b0fef1c38
commit c49b604172
1 changed files with 2 additions and 1 deletions

View File

@ -195,7 +195,8 @@ def wrap_lwlibavsource(filename: str, cachedir: str | None = None, **kwargs: Any
ensure_plugin("lsmas", "libvslsmashsource", "To use Aegisub's LWLibavSource wrapper, the `lsmas` plugin for VapourSynth must be installed")
if b"-Dcachedir" not in core.lsmas.Version()["config"]: # type: ignore
import inspect
if "cachedir" not in inspect.getfullargspec(vs.core.lsmas.LWLibavSource).args:
raise vs.Error("To use Aegisub's LWLibavSource wrapper, the `lsmas` plugin must support the `cachedir` option for LWLibavSource.")
clip = core.lsmas.LWLibavSource(source=filename, cachefile=cachefile, **kwargs)