From 566640a21bed7c3b0b5f1eb586ed154ebe767c54 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Oct 2019 21:45:24 +0200 Subject: [PATCH] audioadapter: fix switch between master and slave When we get worken up with a callback, mark ourselves as a master because we then need to avoid running the converter again in the process callback. After we perform the process callback, unmark ourself as master and wait for the next cycle. This fixes switch from master to slave for sources. --- spa/plugins/audioconvert/audioadapter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index e9bcf7e25..de67b90b7 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -851,8 +851,9 @@ static int impl_node_process(void *object) if (this->direction == SPA_DIRECTION_OUTPUT && !this->master) { if (this->use_converter) status = spa_node_process(this->convert); - this->master = false; } + this->master = false; + return status; }