From 38eb74f66dd55d0ae98ec0e28103770451360bb7 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Fri, 15 Jan 2021 18:16:59 +0200 Subject: [PATCH] switch-on-port-available: Pass correct port_pointers to switch_to_port() The pp variable contains information for the port that became unavailable, but switch_to_port() needs the information for the port that we're switching to. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1096 Part-of: --- src/modules/module-switch-on-port-available.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c index f450004..99d61a4 100644 --- a/src/modules/module-switch-on-port-available.c +++ b/src/modules/module-switch-on-port-available.c @@ -278,8 +278,10 @@ static void switch_from_port(pa_device_port *port, struct port_pointers pp) { * profile is still available in the * PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED callback, as at this point * the profile availability hasn't been updated yet. */ - if (best_port) - switch_to_port(best_port, pp); + if (best_port) { + struct port_pointers best_pp = find_port_pointers(best_port); + switch_to_port(best_port, best_pp); + } } -- 2.7.4