Skip to content

Commit

Permalink
vapoursynth: Improve lsmas plugin version detection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arch1t3cht committed Jul 16, 2024
1 parent 9b0fef1 commit c49b604
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion automation/vapoursynth/aegisub_vs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c49b604

Please sign in to comment.