mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: module-zeroconf-publish: do not query twice
Whether the object is a sink or source is already queried at the
beginning of the function, and is kept in local variables.
Use those instead of calling `pw_manager_object_is_{sink,source}()` again.
This commit is contained in:
parent
7b0af5940e
commit
ce687d6518
1 changed files with 2 additions and 2 deletions
|
|
@ -274,9 +274,9 @@ static void get_service_data(struct module_zeroconf_publish_data *d,
|
||||||
collect_device_info(o, card, &dev_info, false, &impl->defs);
|
collect_device_info(o, card, &dev_info, false, &impl->defs);
|
||||||
|
|
||||||
if ((str = spa_dict_lookup(info->props, PW_KEY_DEVICE_API)) != NULL) {
|
if ((str = spa_dict_lookup(info->props, PW_KEY_DEVICE_API)) != NULL) {
|
||||||
if (pw_manager_object_is_sink(o))
|
if (is_sink)
|
||||||
flags |= SINK_HARDWARE;
|
flags |= SINK_HARDWARE;
|
||||||
else if (pw_manager_object_is_source(o))
|
else if (is_source)
|
||||||
flags |= SOURCE_HARDWARE;
|
flags |= SOURCE_HARDWARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue