mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-21 12:49:40 +08:00
plugins: Remove dynamic default path properties
This commit is contained in:
@@ -306,28 +306,16 @@ static const char *image_filter =
|
||||
|
||||
static obs_properties_t *image_source_properties(void *data)
|
||||
{
|
||||
struct image_source *s = data;
|
||||
struct dstr path = {0};
|
||||
UNUSED_PARAMETER(data);
|
||||
|
||||
obs_properties_t *props = obs_properties_create();
|
||||
|
||||
if (s && s->file && *s->file) {
|
||||
const char *slash;
|
||||
|
||||
dstr_copy(&path, s->file);
|
||||
dstr_replace(&path, "\\", "/");
|
||||
slash = strrchr(path.array, '/');
|
||||
if (slash)
|
||||
dstr_resize(&path, slash - path.array + 1);
|
||||
}
|
||||
|
||||
obs_properties_add_path(props, "file", obs_module_text("File"),
|
||||
OBS_PATH_FILE, image_filter, path.array);
|
||||
OBS_PATH_FILE, image_filter, NULL);
|
||||
obs_properties_add_bool(props, "unload",
|
||||
obs_module_text("UnloadWhenNotShowing"));
|
||||
obs_properties_add_bool(props, "linear_alpha",
|
||||
obs_module_text("LinearAlpha"));
|
||||
dstr_free(&path);
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ static void color_grade_filter_defaults(obs_data_t *settings)
|
||||
|
||||
static obs_properties_t *color_grade_filter_properties(void *data)
|
||||
{
|
||||
struct lut_filter_data *s = data;
|
||||
UNUSED_PARAMETER(data);
|
||||
struct dstr path = {0};
|
||||
const char *slash;
|
||||
|
||||
@@ -391,14 +391,10 @@ static obs_properties_t *color_grade_filter_properties(void *data)
|
||||
|
||||
dstr_cat(&filter_str, "PNG/Cube (*.cube *.png)");
|
||||
|
||||
if (s && s->file && *s->file) {
|
||||
dstr_copy(&path, s->file);
|
||||
} else {
|
||||
char *lut_dir = obs_module_file("LUTs");
|
||||
dstr_copy(&path, lut_dir);
|
||||
dstr_cat_ch(&path, '/');
|
||||
bfree(lut_dir);
|
||||
}
|
||||
char *lut_dir = obs_module_file("LUTs");
|
||||
dstr_copy(&path, lut_dir);
|
||||
dstr_cat_ch(&path, '/');
|
||||
bfree(lut_dir);
|
||||
|
||||
dstr_replace(&path, "\\", "/");
|
||||
slash = strrchr(path.array, '/');
|
||||
|
||||
Reference in New Issue
Block a user