summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/alsa/alsa-sink.c2
-rw-r--r--src/modules/alsa/alsa-source.c2
-rw-r--r--src/modules/alsa/alsa-util.c23
-rw-r--r--src/modules/alsa/alsa-util.h2
-rw-r--r--src/modules/alsa/module-alsa-card.c2
5 files changed, 11 insertions, 20 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index b6fcbb79..7768b38e 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1667,7 +1667,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, profile->description);
}
- pa_alsa_set_description(data.proplist);
+ pa_alsa_init_description(data.proplist);
u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY);
pa_sink_new_data_done(&data);
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index f56b96f3..def638ec 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1509,7 +1509,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, profile->description);
}
- pa_alsa_set_description(data.proplist);
+ pa_alsa_init_description(data.proplist);
u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY);
pa_source_new_data_done(&data);
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 2f06acd0..7d833ff7 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -1366,33 +1366,24 @@ void pa_alsa_redirect_errors_dec(void) {
snd_lib_error_set_handler(NULL);
}
-void pa_alsa_set_description(pa_proplist *p) {
+pa_bool_t pa_alsa_init_description(pa_proplist *p) {
const char *s;
pa_assert(p);
- if (pa_proplist_contains(p, PA_PROP_DEVICE_DESCRIPTION))
- return;
-
- if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_FORM_FACTOR)))
- if (pa_streq(s, "internal")) {
- pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, _("Internal Audio"));
- return;
- }
-
- if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_PRODUCT_NAME))) {
- pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
- return;
- }
+ if (pa_device_init_description(p))
+ return TRUE;
if ((s = pa_proplist_gets(p, "alsa.card_name"))) {
pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
- return;
+ return TRUE;
}
if ((s = pa_proplist_gets(p, "alsa.name"))) {
pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
- return;
+ return TRUE;
}
+
+ return FALSE;
}
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) {
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index 1fb5996a..a8397ae9 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -123,7 +123,7 @@ void pa_alsa_redirect_errors_dec(void);
void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *pcm_info);
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card);
void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_t *pcm);
-void pa_alsa_set_description(pa_proplist *p);
+pa_bool_t pa_alsa_init_description(pa_proplist *p);
int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents);
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index 74f3099b..9e149a48 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -318,7 +318,7 @@ int pa__init(pa_module *m) {
data.module = m;
pa_alsa_init_proplist_card(m->core, data.proplist, alsa_card_index);
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device_id);
- pa_alsa_set_description(data.proplist);
+ pa_alsa_init_description(data.proplist);
set_card_name(&data, ma, u->device_id);
if (reserve)