[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test2-129-g8314858
Lennart Poettering
gitmailer-noreply at 0pointer.de
Tue Feb 24 02:30:10 PST 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from ba3c7668a472672bd86eb06dbbbffcef17722134 (commit)
- Log -----------------------------------------------------------------
8314858... set reserve interface application device name
03ac71b... don't put both the card and the pcm name in the description of a device if one contains the other
-----------------------------------------------------------------------
Summary of changes:
src/modules/alsa/alsa-sink.c | 15 +++++++++++++++
src/modules/alsa/alsa-source.c | 15 +++++++++++++++
src/modules/alsa/alsa-util.c | 6 +++---
src/modules/alsa/module-alsa-card.c | 5 +++++
src/modules/reserve-wrap.c | 12 +++++++++++-
src/modules/reserve-wrap.h | 2 ++
6 files changed, 51 insertions(+), 4 deletions(-)
-----------------------------------------------------------------------
commit 03ac71bcad97f013f1fc7b5ec65f642be437d65b
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Feb 24 11:29:11 2009 +0100
don't put both the card and the pcm name in the description of a device if one contains the other
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index ec20d1d..6740c06 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -1448,9 +1448,9 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *
cn = pa_proplist_gets(p, "alsa.card_name");
}
- if (cn && n)
- pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, "%s - %s", cn, n);
- else if (cn)
+ if (cn && n && !strstr(cn, n) && !strstr(n, cn))
+ pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, "%s, %s", cn, n);
+ else if (cn && (!n || strstr(cn, n)))
pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, cn);
else if (n)
pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, n);
commit 83148581830f6ed9740a6f82645d76c38e43a600
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Feb 24 11:29:35 2009 +0100
set reserve interface application device name
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 83fc9e1..dbd95b6 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -134,6 +134,17 @@ static void reserve_done(struct userdata *u) {
}
}
+static void reserve_update(struct userdata *u) {
+ const char *description;
+ pa_assert(u);
+
+ if (!u->sink)
+ return;
+
+ if ((description = pa_proplist_gets(u->sink->proplist, PA_PROP_DEVICE_DESCRIPTION)))
+ pa_reserve_wrapper_set_application_device_name(u->reserve, description);
+}
+
static int reserve_init(struct userdata *u, const char *dname) {
char *rname;
@@ -153,6 +164,8 @@ static int reserve_init(struct userdata *u, const char *dname) {
if (!(u->reserve))
return -1;
+ reserve_update(u);
+
pa_assert(!u->reserve_slot);
u->reserve_slot = pa_hook_connect(pa_reserve_wrapper_hook(u->reserve), PA_HOOK_NORMAL, (pa_hook_cb_t) reserve_cb, u);
@@ -1684,6 +1697,8 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
pa_log_info("Time scheduling watermark is %0.2fms",
(double) pa_bytes_to_usec(u->tsched_watermark, &ss) / PA_USEC_PER_MSEC);
+ reserve_update(u);
+
if (update_sw_params(u) < 0)
goto fail;
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 2f0e94c..39df4a9 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -132,6 +132,17 @@ static void reserve_done(struct userdata *u) {
}
}
+static void reserve_update(struct userdata *u) {
+ const char *description;
+ pa_assert(u);
+
+ if (!u->source)
+ return;
+
+ if ((description = pa_proplist_gets(u->source->proplist, PA_PROP_DEVICE_DESCRIPTION)))
+ pa_reserve_wrapper_set_application_device_name(u->reserve, description);
+}
+
static int reserve_init(struct userdata *u, const char *dname) {
char *rname;
@@ -151,6 +162,8 @@ static int reserve_init(struct userdata *u, const char *dname) {
if (!(u->reserve))
return -1;
+ reserve_update(u);
+
pa_assert(!u->reserve_slot);
u->reserve_slot = pa_hook_connect(pa_reserve_wrapper_hook(u->reserve), PA_HOOK_NORMAL, (pa_hook_cb_t) reserve_cb, u);
@@ -1522,6 +1535,8 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_log_info("Time scheduling watermark is %0.2fms",
(double) pa_bytes_to_usec(u->tsched_watermark, &ss) / PA_USEC_PER_MSEC);
+ reserve_update(u);
+
if (update_sw_params(u) < 0)
goto fail;
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index 52e64ea..fc6b886 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -282,6 +282,7 @@ int pa__init(pa_module *m) {
struct userdata *u;
char rname[32];
pa_reserve_wrapper *reserve = NULL;
+ const char *description;
pa_alsa_redirect_errors_inc();
snd_config_update_free_global();
@@ -319,6 +320,10 @@ int pa__init(pa_module *m) {
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device_id);
set_card_name(&data, ma, u->device_id);
+ if (reserve)
+ if ((description = pa_proplist_gets(data.proplist, PA_PROP_DEVICE_DESCRIPTION)))
+ pa_reserve_wrapper_set_application_device_name(reserve, description);
+
u->profiles = data.profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
if (pa_alsa_probe_profiles(u->device_id, &m->core->default_sample_spec, enumerate_cb, u) < 0) {
pa_card_new_data_done(&data);
diff --git a/src/modules/reserve-wrap.c b/src/modules/reserve-wrap.c
index df2861f..709cb06 100644
--- a/src/modules/reserve-wrap.c
+++ b/src/modules/reserve-wrap.c
@@ -123,7 +123,7 @@ pa_reserve_wrapper* pa_reserve_wrapper_get(pa_core *c, const char *device_name)
_("PulseAudio Sound Server"),
0,
request_cb,
- &error)) < 0) {
+ NULL)) < 0) {
pa_log_error("Failed to acquire reservation lock on device '%s': %s", device_name, pa_cstrerror(-k));
goto fail;
@@ -136,7 +136,10 @@ pa_reserve_wrapper* pa_reserve_wrapper_get(pa_core *c, const char *device_name)
return r;
fail:
+ dbus_error_free(&error);
+
reserve_wrapper_free(r);
+
return NULL;
}
@@ -156,3 +159,10 @@ pa_hook* pa_reserve_wrapper_hook(pa_reserve_wrapper *r) {
return &r->hook;
}
+
+void pa_reserve_wrapper_set_application_device_name(pa_reserve_wrapper *r, const char *name) {
+ pa_assert(r);
+ pa_assert(PA_REFCNT_VALUE(r) >= 1);
+
+ rd_set_application_device_name(r->device, name);
+}
diff --git a/src/modules/reserve-wrap.h b/src/modules/reserve-wrap.h
index 7afc511..4625fe6 100644
--- a/src/modules/reserve-wrap.h
+++ b/src/modules/reserve-wrap.h
@@ -33,4 +33,6 @@ void pa_reserve_wrapper_unref(pa_reserve_wrapper *r);
pa_hook* pa_reserve_wrapper_hook(pa_reserve_wrapper *r);
+void pa_reserve_wrapper_set_application_device_name(pa_reserve_wrapper *r, const char *name);
+
#endif
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list