mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
combine: Do not set (and update) description if the user passed one in during load.
Note that this will not turn off auto-description setting if the user were to update the proplist later, so such a change could be short lived.
This commit is contained in:
parent
7ee1b471d9
commit
a007d4740f
1 changed files with 12 additions and 1 deletions
|
|
@ -119,6 +119,7 @@ struct userdata {
|
|||
uint32_t adjust_time;
|
||||
|
||||
pa_bool_t automatic;
|
||||
pa_bool_t auto_desc;
|
||||
|
||||
pa_hook_slot *sink_put_slot, *sink_unlink_slot, *sink_state_changed_slot;
|
||||
|
||||
|
|
@ -756,6 +757,9 @@ static void update_description(struct userdata *u) {
|
|||
|
||||
pa_assert(u);
|
||||
|
||||
if (!u->auto_desc)
|
||||
return;
|
||||
|
||||
if (pa_idxset_isempty(u->outputs)) {
|
||||
pa_sink_set_description(u->sink, "Simultaneous output");
|
||||
return;
|
||||
|
|
@ -1073,7 +1077,6 @@ int pa__init(pa_module*m) {
|
|||
pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME));
|
||||
pa_sink_new_data_set_sample_spec(&data, &ss);
|
||||
pa_sink_new_data_set_channel_map(&data, &map);
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Simultaneous Output");
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, "filter");
|
||||
|
||||
if (slaves)
|
||||
|
|
@ -1085,6 +1088,14 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* Check proplist for a description & fill in a default value if not */
|
||||
u->auto_desc = FALSE;
|
||||
if (NULL == pa_proplist_gets(data.proplist, PA_PROP_DEVICE_DESCRIPTION)) {
|
||||
u->auto_desc = TRUE;
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Simultaneous Output");
|
||||
}
|
||||
|
||||
|
||||
u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY);
|
||||
pa_sink_new_data_done(&data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue