From 49846d755026bf0ca41ee4350fab6f023e2075e0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Mar 2021 20:16:28 +0100 Subject: [PATCH] alsa-seq: only mark hardware ports as terminal/physical Use the caps of the port to set the right flags on the new port. We only want to put the terminal/physical flags on ports that look like hardware ports. Port created by clients should not have this flag. --- spa/plugins/alsa/alsa-seq-bridge.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spa/plugins/alsa/alsa-seq-bridge.c b/spa/plugins/alsa/alsa-seq-bridge.c index 10243aea2..29ec8b1cf 100644 --- a/spa/plugins/alsa/alsa-seq-bridge.c +++ b/spa/plugins/alsa/alsa-seq-bridge.c @@ -391,16 +391,17 @@ static void free_port(struct seq_state *state, struct seq_stream *stream, struct spa_zero(*port); } -static void init_port(struct seq_state *state, struct seq_port *port, const snd_seq_addr_t *addr) +static void init_port(struct seq_state *state, struct seq_port *port, const snd_seq_addr_t *addr, + unsigned int caps) { port->addr = *addr; port->info_all = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_PROPS | SPA_PORT_CHANGE_MASK_PARAMS; port->info = SPA_PORT_INFO_INIT(); - port->info.flags = SPA_PORT_FLAG_LIVE | - SPA_PORT_FLAG_PHYSICAL | - SPA_PORT_FLAG_TERMINAL; + port->info.flags = SPA_PORT_FLAG_LIVE; + if (caps & (SND_SEQ_PORT_TYPE_HARDWARE|SND_SEQ_PORT_TYPE_PORT|SND_SEQ_PORT_TYPE_SPECIFIC)) + port->info.flags |= SPA_PORT_FLAG_PHYSICAL | SPA_PORT_FLAG_TERMINAL; port->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ); port->params[1] = SPA_PARAM_INFO(SPA_PARAM_Meta, SPA_PARAM_INFO_READ); port->params[2] = SPA_PARAM_INFO(SPA_PARAM_IO, SPA_PARAM_INFO_READ); @@ -433,7 +434,7 @@ static void update_stream_port(struct seq_state *state, struct seq_stream *strea port = alloc_port(state, stream); if (port == NULL) return; - init_port(state, port, addr); + init_port(state, port, addr, caps); } else if (port != NULL) { if ((caps & stream->caps) != stream->caps) { spa_log_debug(state->log, "free port %d.%d", addr->client, addr->port);