Skip to content

Commit 4965960

Browse files
committed
Prevent running on private sources
1 parent 30fcba6 commit 4965960

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

source-record.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,10 @@ static void update_encoder(struct source_record_filter_context *filter, obs_data
778778
static void source_record_filter_update(void *data, obs_data_t *settings)
779779
{
780780
struct source_record_filter_context *filter = data;
781+
if (obs_obj_is_private(obs_filter_get_parent(filter->source))) {
782+
filter->closing = true;
783+
return;
784+
}
781785
if (obs_data_get_bool(settings, "scale")) {
782786
const char *res = obs_data_get_string(settings, "resolution");
783787
uint32_t width, height;
@@ -1088,7 +1092,7 @@ static void source_record_delayed_destroy(void *data)
10881092

10891093
obs_service_release(context->service);
10901094

1091-
if (context->video_output) {
1095+
if (context->video_output && context->view) {
10921096
obs_view_set_source(context->view, 0, NULL);
10931097
obs_view_remove(context->view);
10941098
context->video_output = NULL;
@@ -1250,6 +1254,11 @@ static void source_record_filter_tick(void *data, float seconds)
12501254
if (!parent)
12511255
return;
12521256

1257+
if (obs_obj_is_private(parent)) {
1258+
context->closing = true;
1259+
return;
1260+
}
1261+
12531262
if (context->enableHotkey == OBS_INVALID_HOTKEY_PAIR_ID)
12541263
context->enableHotkey = obs_hotkey_pair_register_source(
12551264
parent, "source_record.enable", obs_module_text("SourceRecordEnable"), "source_record.disable",

0 commit comments

Comments
 (0)