From 8292c556e9b4a44b81950d632652075523eb5648 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Jun 2020 10:15:37 +0200 Subject: [PATCH] client-node: first set param, then clear buffers Because setting the param might still access the buffer to do cleanup. --- src/modules/module-client-node/remote-node.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index ec3ca6099..0794e88e7 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -558,9 +558,13 @@ client_node_port_set_param(void *object, goto error_exit; } - pw_log_debug("port %p: set param %d %p", port, id, param); + pw_log_debug("port %p: set param %d %p", port, id, param); - if (id == SPA_PARAM_Format) { + res = pw_impl_port_set_param(port, id, flags, param); + if (res < 0) + goto error_exit; + + if (id == SPA_PARAM_Format) { struct mix *mix; spa_list_for_each(mix, &data->mix[direction], link) { if (mix->port->port_id == port_id) @@ -568,14 +572,10 @@ client_node_port_set_param(void *object, } } - res = pw_impl_port_set_param(port, id, flags, param); - if (res < 0) - goto error_exit; - return res; error_exit: - pw_log_error("port %p: set_param %d %p: %s", port, id, param, spa_strerror(res)); + pw_log_error("port %p: set_param %d %p: %s", port, id, param, spa_strerror(res)); pw_proxy_errorf(proxy, res, "port_set_param: %s", spa_strerror(res)); return res; }