Skip to content

Commit bf54624

Browse files
committed
obs: revbump for libvpl
1 parent a096465 commit bf54624

File tree

2 files changed

+65
-23
lines changed

2 files changed

+65
-23
lines changed
Lines changed: 63 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,68 @@
1-
https://github.com/obsproject/obs-studio/issues/11029#issuecomment-2249747587
1+
--- a/libobs/obs-module.c
2+
+++ b/libobs/obs-module.c
3+
@@ -22,6 +22,8 @@
4+
#include "obs-internal.h"
5+
#include "obs-module.h"
6+
7+
+#include <sys/stat.h>
8+
+
9+
extern const char *get_module_extension(void);
10+
11+
static inline int req_func_not_found(const char *name, const char *path)
12+
@@ -269,6 +271,34 @@
13+
if (!obs || !bin || !data)
14+
return;
15+
16+
+ char tmp_data[255] = {0}; // shouldn't hit paths 255 big?
17+
+ for (size_t i = 0; i < obs->module_paths.num; i++) {
18+
+ struct obs_module_path *old_omp = obs->module_paths.array + i;
19+
+ char *mod_loc = 0;
20+
+ struct stat old_bin, new_bin, old_data, new_data;
21+
+ size_t maxlen = strlen(old_omp->data);
22+
+ if (maxlen > 254) {
23+
+ maxlen = 254;
24+
+ blog(LOG_WARNING, "Max length of module path is over void-hackery 254 character length");
25+
+ }
26+
+ memcpy(tmp_data, old_omp->data, maxlen);
27+
+ mod_loc = strstr(tmp_data, "%module%");
28+
+ if (mod_loc) *mod_loc = 0;
29+
+ stat(old_omp->bin, &old_bin);
30+
+ stat(bin, &new_bin);
31+
+ stat(tmp_data, &old_data);
32+
+ stat(data, &new_data);
33+
+ if ((old_bin.st_dev == new_bin.st_dev
34+
+ && old_bin.st_ino == new_bin.st_ino)
35+
+ || (old_data.st_dev == new_data.st_dev
36+
+ && old_data.st_ino == new_data.st_ino) )
37+
+ {
38+
+ blog(LOG_WARNING, "Skipping duplicate module path: bin: '%s', data: '%s'"
39+
+ ,bin, data);
40+
+ return;
41+
+ }
42+
+ }
43+
+
44+
omp.bin = bstrdup(bin);
45+
omp.data = bstrdup(data);
46+
da_push_back(obs->module_paths, &omp);
247
--- a/libobs/obs-nix.c
348
+++ b/libobs/obs-nix.c
4-
@@ -67,22 +67,6 @@ static const struct obs_nix_hotkeys_vtable *hotkeys_vtable = NULL;
5-
6-
void add_default_module_paths(void)
7-
{
8-
- char *module_bin_path = os_get_executable_path_ptr("../" OBS_PLUGIN_PATH);
9-
- char *module_data_path = os_get_executable_path_ptr("../" OBS_DATA_PATH "/obs-plugins/%module%");
10-
-
11-
- if (module_bin_path && module_data_path) {
12-
- char *abs_module_bin_path = os_get_abs_path_ptr(module_bin_path);
13-
-
14-
- if (abs_module_bin_path &&
15-
- strcmp(abs_module_bin_path, OBS_INSTALL_PREFIX "/" OBS_PLUGIN_DESTINATION) != 0) {
16-
- obs_add_module_path(module_bin_path, module_data_path);
17-
- }
18-
- bfree(abs_module_bin_path);
19-
- }
20-
-
21-
- bfree(module_bin_path);
22-
- bfree(module_data_path);
23-
-
49+
@@ -33,6 +33,7 @@
50+
#include <stdlib.h>
51+
#include <stdio.h>
52+
#include <unistd.h>
53+
+#include <sys/stat.h>
54+
#if defined(__FreeBSD__) || defined(__OpenBSD__)
55+
#include <sys/sysctl.h>
56+
#endif
57+
@@ -83,7 +84,11 @@
58+
bfree(module_bin_path);
59+
bfree(module_data_path);
60+
61+
+ struct stat stat_info;
62+
+
2463
for (int i = 0; i < module_patterns_size; i++) {
64+
+ if ((stat(module_bin[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) )
65+
+ && (stat(module_data[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) ) )
2566
obs_add_module_path(module_bin[i], module_data[i]);
2667
}
68+
}

srcpkgs/obs/template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Template file for 'obs'
22
pkgname=obs
33
version=31.0.2
4-
revision=1
4+
revision=2
55
archs="i686* x86_64* ppc64le* aarch64* riscv64*"
66
build_style=cmake
77
configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON
@@ -17,7 +17,7 @@ makedepends="$(vopt_if luajit LuaJIT-devel) fdk-aac-devel
1717
v4l-utils-devel vlc-devel qt6-svg-devel x264-devel mbedtls-devel
1818
jansson-devel wayland-devel pipewire-devel libxkbcommon-devel
1919
pciutils-devel librist-devel srt-devel libdatachannel-devel
20-
oneVPL-devel uthash qt6-base-private-devel json-c++"
20+
libvpl-devel uthash qt6-base-private-devel json-c++"
2121
depends="xset xdg-desktop-portal"
2222
short_desc="Open Broadcaster Software"
2323
maintainer="lemmi <[email protected]>"

0 commit comments

Comments
 (0)