Skip to content

Commit b2e0ed1

Browse files
Eddy Weizglikely
authored andcommitted
Remove deprecated obs_properties_add_button2() call
obs_properties_add_button() is deprecated in OBS 32.2.1 and triggers a -Werror build failure (C4996 / warning-as-error) under the CI presets. Switch to obs_properties_add_button2(), which forwards the source data pointer to the callback. This also fixes the Test Action button, which previously received a NULL context from the deprecated single-arg button callback. Signed-off-by: Eddy Weiz <eddyweiz@gmail.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
1 parent c2b382e commit b2e0ed1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ptz-action-source.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ static bool ptz_action_source_test_clicked_cb(obs_properties_t *props, obs_prope
226226
static obs_properties_t *ptz_action_source_get_properties(void *data)
227227
{
228228
obs_properties_t *props = obs_properties_create();
229-
UNUSED_PARAMETER(data);
230229

231230
/* List the possible trigger events */
232231
obs_property_t *prop =
@@ -258,7 +257,7 @@ static obs_properties_t *ptz_action_source_get_properties(void *data)
258257
obs_properties_add_list(props, "preset_id", "Preset", OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
259258
obs_properties_add_float_slider(props, "pan_speed", "Pan Speed", -1.0, 1.0, 0.01);
260259
obs_properties_add_float_slider(props, "tilt_speed", "Tilt Speed", -1.0, 1.0, 0.01);
261-
obs_properties_add_button(props, "run_action", "Test Action", ptz_action_source_test_clicked_cb);
260+
obs_properties_add_button2(props, "run_action", "Test Action", ptz_action_source_test_clicked_cb, data);
262261

263262
return props;
264263
}

0 commit comments

Comments
 (0)