Skip to content

Commit 2be85b6

Browse files
committed
Fix drag-and-drop for media sources
1 parent 894ff92 commit 2be85b6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/source-defaults-filter.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void source_created_cb(void *data, calldata_t *cd)
9999
}
100100
struct source_defaults *src = data;
101101
obs_source_t *dst = (obs_source_t *)calldata_ptr(cd, "source");
102-
bool already_encountered;
102+
bool already_encountered = false;
103103

104104
src->parent_source = obs_filter_get_parent(src->source);
105105

@@ -133,7 +133,14 @@ static void source_created_cb(void *data, calldata_t *cd)
133133
if (!already_encountered) {
134134
const char *dst_properties_json =
135135
obs_data_get_json(dst_properties);
136-
already_encountered = strcmp(dst_properties_json, "{}") != 0;
136+
const char *dst_id = obs_source_get_unversioned_id(dst);
137+
138+
// Except media sources because drag-and-drop already
139+
// sets properties before the signal is propagated
140+
if (strcmp(dst_id, "ffmpeg_source") != 0) {
141+
already_encountered =
142+
strcmp(dst_properties_json, "{}") != 0;
143+
}
137144
// If the new source has non-default settings (not "{}")
138145
// consider it already encountered, but still write the
139146
// ENCOUNTERED_KEY, so that if the user resets its properties

0 commit comments

Comments
 (0)