summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2021-01-15 18:16:59 +0200
committerTanu Kaskinen <tanuk@iki.fi>2021-01-16 19:27:02 +0200
commita9bd71059661900e31387ff70b8d58bdc38f0d19 (patch)
tree3e47385b8c581be57cd2b69c57c4eca1582a32a5
parentd6c8c9ce37f38ea95275453f75b112b393abc38b (diff)
downloadpulseaudio-a9bd71059661900e31387ff70b8d58bdc38f0d19.tar.gz
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: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/468>
-rw-r--r--src/modules/module-switch-on-port-available.c6
1 files 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 f450004ca..99d61a4b8 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);
+ }
}