[pulseaudio-commits] 2 commits - src/modules
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Thu Jun 27 23:58:37 PDT 2013
src/modules/module-device-manager.c | 5 +++++
src/modules/module-waveout.c | 8 ++------
2 files changed, 7 insertions(+), 6 deletions(-)
New commits:
commit 67132eea1a987a3cecd6f9edefb5f62df7308c97
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Tue Jun 4 20:42:48 2013 +0300
device-manager: Add a sanity check for reading entries
There is code elsewhere that assumes that if user_set_description is
true, then the description is non-NULL.
diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c
index 47c78d4..8f1d9cd 100644
--- a/src/modules/module-device-manager.c
+++ b/src/modules/module-device-manager.c
@@ -304,6 +304,11 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
goto fail;
}
+ if (e->user_set_description && !description) {
+ pa_log("Entry has user_set_description set, but the description is NULL.");
+ goto fail;
+ }
+
e->description = pa_xstrdup(description);
e->icon = pa_xstrdup(icon);
commit 491c6a3a0b0ebf66b8f10097ca35ec4e58ab5fa4
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Fri May 31 22:27:19 2013 +0300
waveout: Simplify setting the device description
diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c
index 39c2ab4..38d0a20 100644
--- a/src/modules/module-waveout.c
+++ b/src/modules/module-waveout.c
@@ -608,7 +608,6 @@ int pa__init(pa_module *m) {
InitializeCriticalSection(&u->crit);
if (hwi != INVALID_HANDLE_VALUE) {
- char *description = pa_sprintf_malloc("WaveIn on %s", device_name);
pa_source_new_data data;
pa_source_new_data_init(&data);
data.driver = __FILE__;
@@ -616,19 +615,17 @@ int pa__init(pa_module *m) {
pa_source_new_data_set_sample_spec(&data, &ss);
pa_source_new_data_set_channel_map(&data, &map);
pa_source_new_data_set_name(&data, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME));
+ pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "WaveIn on %s", device_name);
u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY);
pa_source_new_data_done(&data);
pa_assert(u->source);
u->source->userdata = u;
- pa_source_set_description(u->source, description);
u->source->parent.process_msg = process_msg;
- pa_xfree(description);
} else
u->source = NULL;
if (hwo != INVALID_HANDLE_VALUE) {
- char *description = pa_sprintf_malloc("WaveOut on %s", device_name);
pa_sink_new_data data;
pa_sink_new_data_init(&data);
data.driver = __FILE__;
@@ -636,6 +633,7 @@ int pa__init(pa_module *m) {
pa_sink_new_data_set_sample_spec(&data, &ss);
pa_sink_new_data_set_channel_map(&data, &map);
pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME));
+ pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "WaveOut on %s", device_name);
u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY);
pa_sink_new_data_done(&data);
@@ -643,9 +641,7 @@ int pa__init(pa_module *m) {
pa_sink_set_get_volume_callback(u->sink, sink_get_volume_cb);
pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb);
u->sink->userdata = u;
- pa_sink_set_description(u->sink, description);
u->sink->parent.process_msg = process_msg;
- pa_xfree(description);
} else
u->sink = NULL;
More information about the pulseaudio-commits
mailing list