Search for plugins without lib prefix

Fixes #213
This commit is contained in:
BtbN 2014-07-19 10:25:55 +02:00
parent c5c8cba74d
commit 1098c75d34

View File

@ -41,7 +41,7 @@ static inline bool check_lib_path(const char* data, const char *path,
bool result = false;
struct dstr tmp;
dstr_init_copy(&tmp, "lib");
dstr_init(&tmp);
dstr_cat(&tmp, data);
dstr_cat(&tmp, ".so");
result = check_path(tmp.array, path, output);
@ -63,9 +63,15 @@ char *find_plugin(const char *plugin)
if(sizeof(void*) == 4) {
if (check_lib_path(plugin, "../../obs-plugins/32bit/", &output))
return output.array;
if (check_lib_path(plugin, "../../obs-plugins/32bit/lib", &output))
return output.array;
} else {
if (check_lib_path(plugin, "../../obs-plugins/64bit/", &output))
return output.array;
if (check_lib_path(plugin, "../../obs-plugins/64bit/lib", &output))
return output.array;
}
if (OBS_INSTALL_PREFIX [0] != 0) {
@ -73,6 +79,11 @@ char *find_plugin(const char *plugin)
OBS_INSTALL_PREFIX "lib/obs-plugins/",
&output))
return output.array;
if (check_lib_path(plugin,
OBS_INSTALL_PREFIX "lib/obs-plugins/lib",
&output))
return output.array;
}
dstr_free(&output);