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>
This commit is contained in:
Tanu Kaskinen 2021-01-15 18:16:59 +02:00
parent 613b3ebc2c
commit 38eb74f66d

View file

@ -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);
}
}