From c4c6a3fd1bcd91b88fa832d115414eb21b39fd24 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 21 Jun 2023 15:58:41 +0200 Subject: [PATCH] Revert "module-loopback: request renegotiation when suspended" This reverts commit bbf8f1a0c8eee3c6bd2efca5f69f507f8f992b0f. This causes all kinds of things to go wrong, mostly failure to renegotiate buffers. Needs more testing. --- src/modules/module-filter-chain.c | 14 -------------- src/modules/module-loopback.c | 22 +--------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index a514e74c0..541cf2c73 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -1124,18 +1124,6 @@ static void state_changed(void *data, enum pw_stream_state old, } } -static void param_format_cleared(struct impl *impl, struct pw_stream *other, - struct spa_audio_info_raw *other_info) -{ - uint8_t buffer[1024]; - struct spa_pod_builder b; - const struct spa_pod *params[1]; - - spa_pod_builder_init(&b, buffer, sizeof(buffer)); - params[0] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, other_info); - pw_stream_update_params(other, params, 1); -} - static void param_changed(void *data, uint32_t id, const struct spa_pod *param) { struct impl *impl = data; @@ -1146,8 +1134,6 @@ static void param_changed(void *data, uint32_t id, const struct spa_pod *param) case SPA_PARAM_Format: if (param == NULL) { graph_cleanup(graph); - param_format_cleared(impl, impl->capture, &impl->capture_info); - param_format_cleared(impl, impl->playback, &impl->playback_info); } else { struct spa_audio_info_raw info; spa_zero(info); diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c index a2328086b..cf938c563 100644 --- a/src/modules/module-loopback.c +++ b/src/modules/module-loopback.c @@ -332,18 +332,6 @@ static void param_latency_changed(struct impl *impl, const struct spa_pod *param impl->recalc_delay = true; } -static void param_format_cleared(struct impl *impl, struct pw_stream *other, - struct spa_audio_info_raw *other_info) -{ - uint8_t buffer[1024]; - struct spa_pod_builder b; - const struct spa_pod *params[1]; - - spa_pod_builder_init(&b, buffer, sizeof(buffer)); - params[0] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, other_info); - pw_stream_update_params(other, params, 1); -} - static void stream_state_changed(void *data, enum pw_stream_state old, enum pw_stream_state state, const char *error) { @@ -398,10 +386,8 @@ static void capture_param_changed(void *data, uint32_t id, const struct spa_pod case SPA_PARAM_Format: { struct spa_audio_info_raw info; - if (param == NULL) { - param_format_cleared(impl, impl->playback, &impl->playback_info); + if (param == NULL) return; - } if (spa_format_audio_raw_parse(param, &info) < 0) return; if (info.rate == 0 || @@ -439,12 +425,6 @@ static void playback_param_changed(void *data, uint32_t id, const struct spa_pod struct impl *impl = data; switch (id) { - case SPA_PARAM_Format: - if (param == NULL) { - param_format_cleared(impl, impl->capture, &impl->capture_info); - return; - } - break; case SPA_PARAM_Latency: param_latency_changed(impl, param, &impl->playback_latency, impl->capture); break;