Skip to content

Commit

Permalink
vapoursynth: Switch from bestaudiosource to BestSource
Browse files Browse the repository at this point in the history
BestSource now had its first official release, so this is possible now.
  • Loading branch information
arch1t3cht committed Mar 7, 2024
1 parent deb0f19 commit bf8bbb6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions automation/vapoursynth/aegisub_vs.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,15 @@ def get_keyframes(filename: str, clip: vs.VideoNode, fallback: str | List[int],
def check_audio(filename: str, **kwargs: Any) -> bool:
"""
Checks whether the given file has an audio track by trying to open it with
BestAudioSource. Requires the `bas` plugin to return correct results, but
BestSource. Requires the `bs` plugin to return correct results, but
won't crash if it's not installed.
Additional keyword arguments are passed on to BestAudioSource.
Additional keyword arguments are passed on to BestSource.
"""
progress_set_message("Checking if the file has an audio track")
progress_set_indeterminate()
try:
ensure_plugin("bas", "BestAudioSource", "")
vs.core.bas.Source(source=filename, **kwargs)
ensure_plugin("bs", "BestSource", "")
vs.core.bs.AudioSource(source=filename, **kwargs)
return True
except AttributeError:
pass
Expand Down
2 changes: 1 addition & 1 deletion packages/win_installer/fragment_codecs.iss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\plugins\DirectShowSource.
DestDir: {app}\csri; Source: {#DEPS_DIR}\VSFilter\x64\VSFilter.dll; Flags: ignoreversion; Components: main
; VapourSynth
DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\L-SMASH-Works\libvslsmashsource.dll; Flags: ignoreversion; Components: vapoursynth
DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\bestaudiosource\win64\BestAudioSource.dll; Flags: ignoreversion; Components: vapoursynth
DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\BestSource\x64\BestSource.dll; Flags: ignoreversion; Components: vapoursynth
DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\SCXVid\libscxvid.dll; Flags: ignoreversion; Components: vapoursynth
DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\WWXD\libwwxd64.dll; Flags: ignoreversion; Components: vapoursynth
2 changes: 1 addition & 1 deletion src/libresrc/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
"Aegisub Cache" : true
},
"VapourSynth" : {
"Default Script" : "# This default script will load an audio file using BestAudioSource.\n# It requires the `bas` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(locals())\n\na.ensure_plugin(\"bas\", \"BestAudioSource\", \"To use Aegisub's default audio loader, the `bas` plugin for VapourSynth must be installed\")\nvs.core.bas.Source(source=filename).set_output()"
"Default Script" : "# This default script will load an audio file using BestSource.\n# It requires the `bs` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(locals())\n\na.ensure_plugin(\"bs\", \"BestSource\", \"To use Aegisub's default audio loader, the `bs` plugin for VapourSynth must be installed\")\nvs.core.bs.AudioSource(source=filename).set_output()"
}
},
"Avisynth" : {
Expand Down
2 changes: 1 addition & 1 deletion src/libresrc/osx/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
"Aegisub Cache" : true
},
"VapourSynth" : {
"Default Script" : "# This default script will load an audio file using BestAudioSource.\n# It requires the `bas` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(globals())\n\na.ensure_plugin(\"bas\", \"BestAudioSource\", \"To use Aegisub's default audio loader, the `bas` plugin for VapourSynth must be installed\")\nvs.core.bas.Source(source=filename).set_output()"
"Default Script" : "# This default script will load an audio file using BestSource.\n# It requires the `bs` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(locals())\n\na.ensure_plugin(\"bs\", \"BestSource\", \"To use Aegisub's default audio loader, the `bs` plugin for VapourSynth must be installed\")\nvs.core.bs.AudioSource(source=filename).set_output()"
}
},
"Avisynth" : {
Expand Down
18 changes: 9 additions & 9 deletions tools/win-installer-setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ if (!(Test-Path L-SMASH-Works)) {
Remove-Item release-x86_64-cachedir-cwd.zip
}

# bestaudiosource
if (!(Test-Path bestaudiosource)) {
$basDir = New-Item -ItemType Directory bestaudiosource
Set-Location $basDir
$basReleases = Invoke-WebRequest "https://api.github.com/repos/vapoursynth/bestaudiosource/releases/latest" -Headers $GitHeaders -UseBasicParsing | ConvertFrom-Json
$basUrl = $basReleases.assets[0].browser_download_url
Invoke-WebRequest $basUrl -OutFile bas-r1.7z -UseBasicParsing
7z x bas-r1.7z
Remove-Item bas-r1.7z
# BestSource
if (!(Test-Path BestSource)) {
$bsDir = New-Item -ItemType Directory BestSource
Set-Location $bsDir
$basReleases = Invoke-WebRequest "https://api.github.com/repos/vapoursynth/bestsource/releases/latest" -Headers $GitHeaders -UseBasicParsing | ConvertFrom-Json
$bsUrl = $basReleases.assets[0].browser_download_url
Invoke-WebRequest $bsUrl -OutFile bestsource.7z -UseBasicParsing
7z x bestsource.7z
Remove-Item bestsource.7z
Set-Location $DepsDir
}

Expand Down

0 comments on commit bf8bbb6

Please sign in to comment.