From ea7a731106ecb02b5e80944974681985d851ff07 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 1 Sep 2021 13:21:31 +0200 Subject: [PATCH] pulse-server: set the SINK_SET_FORMATS flag When we have an iec958Codecs property on the node, we can use it to configure the codecs on the sink. --- src/modules/module-protocol-pulse/collect.c | 2 ++ src/modules/module-protocol-pulse/collect.h | 1 + src/modules/module-protocol-pulse/pulse-server.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/modules/module-protocol-pulse/collect.c b/src/modules/module-protocol-pulse/collect.c index 78a00fb42..0d786c7c8 100644 --- a/src/modules/module-protocol-pulse/collect.c +++ b/src/modules/module-protocol-pulse/collect.c @@ -281,6 +281,8 @@ void collect_device_info(struct pw_manager_object *device, struct pw_manager_obj volume_parse_param(p->param, &dev_info->volume_info, monitor); dev_info->have_volume = true; } + dev_info->have_iec958codecs = spa_pod_find_prop(p->param, + NULL, SPA_PROP_iec958Codecs) != NULL; break; } } diff --git a/src/modules/module-protocol-pulse/collect.h b/src/modules/module-protocol-pulse/collect.h index ad15846ea..5d6190a81 100644 --- a/src/modules/module-protocol-pulse/collect.h +++ b/src/modules/module-protocol-pulse/collect.h @@ -63,6 +63,7 @@ struct device_info { struct channel_map map; struct volume_info volume_info; unsigned int have_volume:1; + unsigned int have_iec958codecs:1; uint32_t device; uint32_t active_port; diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 3a466e2fb..1feb4d5ac 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -3488,6 +3488,8 @@ static int fill_sink_info(struct client *client, struct message *m, flags |= SINK_HW_VOLUME_CTRL; if (SPA_FLAG_IS_SET(dev_info.volume_info.flags, VOLUME_HW_MUTE)) flags |= SINK_HW_MUTE_CTRL; + if (dev_info.have_iec958codecs) + flags |= SINK_SET_FORMATS; if (client->quirks & QUIRK_FORCE_S16_FORMAT) dev_info.ss.format = SPA_AUDIO_FORMAT_S16;