summaryrefslogtreecommitdiff
path: root/src/pulsecore/device-port.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/device-port.c')
-rw-r--r--src/pulsecore/device-port.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
index 8263c9e9b..4f9235e51 100644
--- a/src/pulsecore/device-port.c
+++ b/src/pulsecore/device-port.c
@@ -119,8 +119,6 @@ void pa_device_port_set_available(pa_device_port *p, pa_available_t status) {
if (source)
pa_subscription_post(p->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, source->index);
- pa_hook_fire(&p->core->hooks[PA_CORE_HOOK_PORT_AVAILABLE_CHANGED], p);
-
/* A sink or source whose active port is unavailable can't be the
* default sink/source, so port availability changes may affect the
* default sink/source choice. */
@@ -146,6 +144,11 @@ void pa_device_port_set_available(pa_device_port *p, pa_available_t status) {
pa_core_move_streams_to_newly_available_preferred_source(p->core, source);
}
}
+
+ /* This may cause the sink and source pointers to become invalid, if
+ * the availability change causes the card profile to get switched. If
+ * you add code after this line, remember to take that into account. */
+ pa_hook_fire(&p->core->hooks[PA_CORE_HOOK_PORT_AVAILABLE_CHANGED], p);
}
}