summaryrefslogtreecommitdiff
path: root/pipewire-pulseaudio
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2020-08-19 16:48:25 +0200
committerWim Taymans <wtaymans@redhat.com>2020-08-19 16:48:25 +0200
commitbb323a82a74ccf03fa4cf00124445d0aca1e2be0 (patch)
tree2d2bb851717589dbbc5c0e4f3dce95888a7182b9 /pipewire-pulseaudio
parent4e17d4cdf88d354494e355039347c04ad30d256e (diff)
stream: call the moved_callback when moved
Diffstat (limited to 'pipewire-pulseaudio')
-rw-r--r--pipewire-pulseaudio/src/stream.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pipewire-pulseaudio/src/stream.c b/pipewire-pulseaudio/src/stream.c
index c5f5aabc..7ab0b249 100644
--- a/pipewire-pulseaudio/src/stream.c
+++ b/pipewire-pulseaudio/src/stream.c
@@ -61,13 +61,13 @@ static void configure_device(pa_stream *s)
{
struct global *g;
const char *str;
+ uint32_t old = s->device_index;
g = pa_context_find_linked(s->context, pa_stream_get_index(s));
if (g == NULL) {
s->device_index = PA_INVALID_INDEX;
s->device_name = NULL;
- }
- else {
+ } else {
if (s->direction == PA_STREAM_RECORD) {
if (g->mask == (PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE))
s->device_index = g->node_info.monitor;
@@ -85,6 +85,9 @@ static void configure_device(pa_stream *s)
s->device_name = strdup(str);
}
pw_log_debug("stream %p: linked to %d '%s'", s, s->device_index, s->device_name);
+
+ if (old != s->device_index && s->moved_callback)
+ s->moved_callback(s, s->moved_userdata);
}
static void stream_destroy(void *data)