change usage of pw_loop_invoke

This commit is contained in:
Frank Krick 2025-08-19 12:00:21 -04:00
parent 3ccd3b15a0
commit b180438203

View file

@ -1260,8 +1260,16 @@ static int apply_props(struct spa_loop *loop, bool async, uint32_t seq, const vo
size_t size, void *user_data) size_t size, void *user_data)
{ {
const struct impl *impl = user_data; const struct impl *impl = user_data;
const struct spa_pod *props = data; const struct spa_pod *pod = data;
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props);
struct spa_pod_control *pod_control;
SPA_POD_SEQUENCE_FOREACH((struct spa_pod_sequence *)pod, pod_control) {
if (pod_control->type == SPA_CONTROL_Properties) {
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT,
&pod_control->value);
}
}
return 0; return 0;
} }
@ -1280,16 +1288,9 @@ static void control_process(void *d)
control->buffer->datas[0].chunk->size); control->buffer->datas[0].chunk->size);
if (spa_pod_is_sequence(pod)) { if (spa_pod_is_sequence(pod)) {
struct spa_pod_sequence *sequence = (struct spa_pod_sequence *)pod;
struct spa_pod_control *pod_control;
SPA_POD_SEQUENCE_FOREACH(sequence, pod_control) {
if (pod_control->type == SPA_CONTROL_Properties) {
struct pw_loop *loop = pw_context_get_main_loop(impl->context); struct pw_loop *loop = pw_context_get_main_loop(impl->context);
pw_loop_invoke(loop, apply_props, 0, &pod_control->value, pw_loop_invoke(loop, apply_props, 0, pod, SPA_POD_SIZE(pod),
SPA_POD_SIZE(&pod_control->value), false, impl); false, impl);
}
}
} }
} }