Skip to content

Commit

Permalink
bestsource: Bump to R1
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Mar 7, 2024
1 parent 167b4ad commit b0847c4
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 197 deletions.
2 changes: 1 addition & 1 deletion src/audio_provider_bestsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BSAudioProvider final : public agi::AudioProvider {
/// @param filename The filename to open
BSAudioProvider::BSAudioProvider(agi::fs::path const& filename, agi::BackgroundRunner *br) try
: bsopts()
, bs(filename.string(), -1, -1, GetBSCacheFile(filename), &bsopts)
, bs(filename.string(), -1, -1, 0, GetBSCacheFile(filename), &bsopts)
{
bs.SetMaxCacheSize(OPT_GET("Provider/Audio/BestSource/Max Cache Size")->GetInt() << 20);
br->Run([&](agi::ProgressSink *ps) {
Expand Down
4 changes: 2 additions & 2 deletions src/video_provider_bestsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ std::string colormatrix_description(const AVFrame *frame) {

BSVideoProvider::BSVideoProvider(agi::fs::path const& filename, std::string const& colormatrix, agi::BackgroundRunner *br) try
: bsopts()
, bs(filename.string(), "", -1, false, OPT_GET("Provider/Video/BestSource/Threads")->GetInt(), GetBSCacheFile(filename), &bsopts)
, bs(filename.string(), "", 0, -1, false, OPT_GET("Provider/Video/BestSource/Threads")->GetInt(), GetBSCacheFile(filename), &bsopts)
{
bs.SetMaxCacheSize(OPT_GET("Provider/Video/BestSource/Max Cache Size")->GetInt() << 20);
bs.SetSeekPreRoll(OPT_GET("Provider/Video/BestSource/Seek Preroll")->GetInt());
try {
BestAudioSource dummysource(filename.string(), -1, 0, "");
BestAudioSource dummysource(filename.string(), -1, 0, 0, "");
has_audio = true;
} catch (AudioException const& err) {
has_audio = false;
Expand Down
5 changes: 3 additions & 2 deletions subprojects/bestsource.wrap
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[wrap-git]
url = https://github.com/vapoursynth/bestsource
revision = ba1249c1f5443be6d0ec2be32490af5bbc96bf99
patch_directory = bestsource
revision = R1
clone-recursive = true
diff_files = bestsource/0001.patch

[provide]
bestsource = bestsource_dep
65 changes: 65 additions & 0 deletions subprojects/packagefiles/bestsource/0001.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
diff --git a/meson.build b/meson.build
index 38de461..347fccb 100644
--- a/meson.build
+++ b/meson.build
@@ -2,10 +2,6 @@ project('BestSource', 'cpp',
default_options: ['buildtype=release', 'b_lto=true', 'b_ndebug=if-release', 'cpp_std=c++14'],
license: 'MIT',
meson_version: '>=0.53.0',
- version: '.'.join([
- run_command('grep', 'BEST_SOURCE_VERSION_MAJOR', 'src/version.h', check: true).stdout().strip().split()[2],
- run_command('grep', 'BEST_SOURCE_VERSION_MINOR', 'src/version.h', check: true).stdout().strip().split()[2]
- ])
)

link_static = get_option('link_static')
@@ -15,7 +11,6 @@ sources = [
'src/BSRational.cpp',
'src/BSShared.cpp',
'src/SrcAttribCache.cpp',
- 'src/vapoursynth.cpp',
'src/videosource.cpp'
]

@@ -46,17 +41,22 @@ if host_machine.cpu_family().startswith('x86')
)
endif

-vapoursynth_dep = dependency('vapoursynth', version: '>=55').partial_dependency(compile_args: true, includes: true)
-
deps = [
- vapoursynth_dep,
- dependency('jansson', version: '>=2.12', static: link_static),
dependency('libavcodec', version: '>=60.31.0', static: link_static),
dependency('libavformat', version: '>=60.16.0', static: link_static),
dependency('libavutil', version: '>=58.29.0', static: link_static),
dependency('libswscale', version: '>=7.5.0', static: link_static)
]

+jansson_dep = dependency('jansson', version: '>= 2.12', required: false)
+
+if jansson_dep.found()
+ deps += jansson_dep
+else
+ jansson = cmake.subproject('jansson')
+ deps += jansson.dependency('jansson')
+endif
+
is_gnu_linker = meson.get_compiler('cpp').get_linker_id() in ['ld.bfd', 'ld.gold', 'ld.mold']
link_args = []

@@ -66,11 +66,11 @@ elif is_gnu_linker
link_args += ['-Wl,-Bsymbolic']
endif

-shared_module('bestsource', sources,
+bs_lib = static_library('bestsource', sources,
dependencies: deps,
gnu_symbol_visibility: 'hidden',
- install: true,
- install_dir: vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth',
link_args: link_args,
link_with: libs
)
+
+bestsource_dep = declare_dependency(link_with: bs_lib, include_directories: include_directories('src'))
156 changes: 0 additions & 156 deletions subprojects/packagefiles/bestsource/libp2p/p2p_api.h

This file was deleted.

36 changes: 0 additions & 36 deletions subprojects/packagefiles/bestsource/meson.build

This file was deleted.

0 comments on commit b0847c4

Please sign in to comment.