From d7376b73049f45b5894c10f263b81a140775de57 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 2 Nov 2018 12:31:08 +0100 Subject: [PATCH] alsa: fix for target_id --- alsa-plugins/pcm_pipewire.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/alsa-plugins/pcm_pipewire.c b/alsa-plugins/pcm_pipewire.c index 56a78df1e..75edb1380 100644 --- a/alsa-plugins/pcm_pipewire.c +++ b/alsa-plugins/pcm_pipewire.c @@ -51,7 +51,7 @@ typedef struct { snd_pcm_ioplug_t io; char *node_name; - char *target; + uint32_t target; int fd; bool activated; /* PipeWire is activated? */ @@ -838,13 +838,14 @@ static int snd_pcm_pipewire_open(snd_pcm_t **pcmp, const char *name, else pw->node_name = strdup(node_name); + pw->target = SPA_ID_INVALID; if (str != NULL) - pw->target = strdup(str); + pw->target = atoi(str); else { if (stream == SND_PCM_STREAM_PLAYBACK) - pw->target = playback_node ? strdup(playback_node) : NULL; + pw->target = playback_node ? atoi(playback_node) : SPA_ID_INVALID; else - pw->target = capture_node ? strdup(capture_node) : NULL; + pw->target = capture_node ? atoi(capture_node) : SPA_ID_INVALID; } pw->loop = pw_loop_new(NULL);