Browse Source

plugins: Remove dynamic default path properties

Warchamp7 1 year ago
parent
commit
b67338c448
2 changed files with 7 additions and 23 deletions
  1. 2 14
      plugins/image-source/image-source.c
  2. 5 9
      plugins/obs-filters/color-grade-filter.c

+ 2 - 14
plugins/image-source/image-source.c

@@ -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;
 }

+ 5 - 9
plugins/obs-filters/color-grade-filter.c

@@ -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, '/');