summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-alsa-sink.c6
-rw-r--r--src/modules/module-alsa-source.c4
-rw-r--r--src/modules/module-combine.c2
-rw-r--r--src/modules/module-esound-sink.c5
-rw-r--r--src/modules/module-jack-sink.c4
-rw-r--r--src/modules/module-jack-source.c4
-rw-r--r--src/modules/module-null-sink.c2
-rw-r--r--src/modules/module-oss-mmap.c24
-rw-r--r--src/modules/module-oss.c24
-rw-r--r--src/modules/module-pipe-sink.c6
-rw-r--r--src/modules/module-pipe-source.c6
-rw-r--r--src/modules/module-solaris.c7
-rw-r--r--src/modules/module-tunnel.c9
-rw-r--r--src/modules/module-waveout.c4
-rw-r--r--src/modules/module-zeroconf-publish.c3
15 files changed, 69 insertions, 41 deletions
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index 649fe99c..efecfc21 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -366,7 +366,8 @@ int pa__init(pa_core *c, pa_module*m) {
size_t frame_size;
snd_pcm_info_t *pcm_info = NULL;
int err;
-
+ char *t;
+
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
pa_log(__FILE__": failed to parse module arguments");
goto fail;
@@ -457,7 +458,8 @@ int pa__init(pa_core *c, pa_module*m) {
}
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("ALSA PCM on %s (%s)", dev, snd_pcm_info_get_name(pcm_info));
+ pa_sink_set_description(u->sink, t = pa_sprintf_malloc("ALSA PCM on %s (%s)", dev, snd_pcm_info_get_name(pcm_info)));
+ pa_xfree(t);
u->pcm_fdl = pa_alsa_fdlist_new();
assert(u->pcm_fdl);
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index 63369e47..6149224a 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -359,6 +359,7 @@ int pa__init(pa_core *c, pa_module*m) {
size_t frame_size;
snd_pcm_info_t *pcm_info = NULL;
int err;
+ char *t;
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
pa_log(__FILE__": failed to parse module arguments");
@@ -450,7 +451,8 @@ int pa__init(pa_core *c, pa_module*m) {
}
}
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("ALSA PCM on %s (%s)", dev, snd_pcm_info_get_name(pcm_info));
+ pa_source_set_description(u->source, t = pa_sprintf_malloc("ALSA PCM on %s (%s)", dev, snd_pcm_info_get_name(pcm_info)));
+ pa_xfree(t);
u->pcm_fdl = pa_alsa_fdlist_new();
assert(u->pcm_fdl);
diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index 4e3dd555..0a5bd472 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -381,7 +381,7 @@ int pa__init(pa_core *c, pa_module*m) {
}
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("Combined sink");
+ pa_sink_set_description(u->sink, "Combined sink");
u->sink->get_latency = sink_get_latency_cb;
u->sink->userdata = u;
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index 86ffaf78..9f0c2c5b 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -320,6 +320,8 @@ int pa__init(pa_core *c, pa_module*m) {
const char *p;
pa_sample_spec ss;
pa_modargs *ma = NULL;
+ char *t;
+
assert(c && m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
@@ -381,7 +383,8 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->get_latency = get_latency_cb;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("Esound sink '%s'", p);
+ pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Esound sink '%s'", p));
+ pa_xfree(t);
u->memchunk.memblock = NULL;
u->memchunk.length = 0;
diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c
index c645caa9..286f6f57 100644
--- a/src/modules/module-jack-sink.c
+++ b/src/modules/module-jack-sink.c
@@ -245,6 +245,7 @@ int pa__init(pa_core *c, pa_module*m) {
int do_connect = 1;
unsigned i;
const char **ports = NULL, **p;
+ char *t;
assert(c);
assert(m);
@@ -328,7 +329,8 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("Jack sink (%s)", jack_get_client_name(u->client));
+ pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Jack sink (%s)", jack_get_client_name(u->client)));
+ pa_xfree(t);
u->sink->get_latency = sink_get_latency_cb;
jack_set_process_callback(u->client, jack_process, u);
diff --git a/src/modules/module-jack-source.c b/src/modules/module-jack-source.c
index 2a492929..583f3b8e 100644
--- a/src/modules/module-jack-source.c
+++ b/src/modules/module-jack-source.c
@@ -243,6 +243,7 @@ int pa__init(pa_core *c, pa_module*m) {
int do_connect = 1;
unsigned i;
const char **ports = NULL, **p;
+ char *t;
assert(c);
assert(m);
@@ -326,7 +327,8 @@ int pa__init(pa_core *c, pa_module*m) {
u->source->userdata = u;
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("Jack source (%s)", jack_get_client_name(u->client));
+ pa_source_set_description(u->source, t = pa_sprintf_malloc("Jack source (%s)", jack_get_client_name(u->client)));
+ pa_xfree(t);
u->source->get_latency = source_get_latency_cb;
jack_set_process_callback(u->client, jack_process, u);
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 470be6bc..73cacc72 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -141,7 +141,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->get_latency = get_latency;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_xstrdup("NULL sink");
+ pa_sink_set_description(u->sink, "NULL sink");
u->n_bytes = 0;
pa_gettimeofday(&u->start_time);
diff --git a/src/modules/module-oss-mmap.c b/src/modules/module-oss-mmap.c
index 4212febe..cc408f90 100644
--- a/src/modules/module-oss-mmap.c
+++ b/src/modules/module-oss-mmap.c
@@ -349,7 +349,7 @@ int pa__init(pa_core *c, pa_module*m) {
int enable_bits = 0, zero = 0;
int playback = 1, record = 1;
pa_modargs *ma = NULL;
- char hwdesc[64];
+ char hwdesc[64], *t;
pa_channel_map map;
assert(c);
@@ -439,11 +439,12 @@ int pa__init(pa_core *c, pa_module*m) {
u->source->get_hw_volume = source_get_hw_volume;
u->source->set_hw_volume = source_set_hw_volume;
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("OSS PCM/mmap() on %s%s%s%s",
- p,
- hwdesc[0] ? " (" : "",
- hwdesc[0] ? hwdesc : "",
- hwdesc[0] ? ")" : "");
+ pa_source_set_description(u->source, t = pa_sprintf_malloc("OSS PCM/mmap() on %s%s%s%s",
+ p,
+ hwdesc[0] ? " (" : "",
+ hwdesc[0] ? hwdesc : "",
+ hwdesc[0] ? ")" : ""));
+ pa_xfree(t);
u->source->is_hardware = 1;
u->in_memblocks = pa_xnew0(pa_memblock*, u->in_fragments);
@@ -480,11 +481,12 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->set_hw_volume = sink_set_hw_volume;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("OSS PCM/mmap() on %s%s%s%s",
- p,
- hwdesc[0] ? " (" : "",
- hwdesc[0] ? hwdesc : "",
- hwdesc[0] ? ")" : "");
+ pa_sink_set_description(u->sink, t = pa_sprintf_malloc("OSS PCM/mmap() on %s%s%s%s",
+ p,
+ hwdesc[0] ? " (" : "",
+ hwdesc[0] ? hwdesc : "",
+ hwdesc[0] ? ")" : ""));
+ pa_xfree(t);
u->sink->is_hardware = 1;
u->out_memblocks = pa_xmalloc0(sizeof(struct memblock *)*u->out_fragments);
diff --git a/src/modules/module-oss.c b/src/modules/module-oss.c
index c9fce7a7..085ae5da 100644
--- a/src/modules/module-oss.c
+++ b/src/modules/module-oss.c
@@ -326,7 +326,7 @@ int pa__init(pa_core *c, pa_module*m) {
pa_sample_spec ss;
pa_channel_map map;
pa_modargs *ma = NULL;
- char hwdesc[64];
+ char hwdesc[64], *t;
assert(c);
assert(m);
@@ -413,11 +413,12 @@ int pa__init(pa_core *c, pa_module*m) {
u->source->get_hw_volume = source_get_hw_volume;
u->source->set_hw_volume = source_set_hw_volume;
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("OSS PCM on %s%s%s%s",
- p,
- hwdesc[0] ? " (" : "",
- hwdesc[0] ? hwdesc : "",
- hwdesc[0] ? ")" : "");
+ pa_source_set_description(u->source, t = pa_sprintf_malloc("OSS PCM on %s%s%s%s",
+ p,
+ hwdesc[0] ? " (" : "",
+ hwdesc[0] ? hwdesc : "",
+ hwdesc[0] ? ")" : ""));
+ pa_xfree(t);
u->source->is_hardware = 1;
} else
u->source = NULL;
@@ -431,11 +432,12 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->set_hw_volume = sink_set_hw_volume;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("OSS PCM on %s%s%s%s",
- p,
- hwdesc[0] ? " (" : "",
- hwdesc[0] ? hwdesc : "",
- hwdesc[0] ? ")" : "");
+ pa_sink_set_description(u->sink, pa_sprintf_malloc("OSS PCM on %s%s%s%s",
+ p,
+ hwdesc[0] ? " (" : "",
+ hwdesc[0] ? hwdesc : "",
+ hwdesc[0] ? ")" : ""));
+ pa_xfree(t);
u->sink->is_hardware = 1;
} else
u->sink = NULL;
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index 4878a1a1..cc5276d4 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -148,6 +148,8 @@ int pa__init(pa_core *c, pa_module*m) {
pa_sample_spec ss;
pa_channel_map map;
pa_modargs *ma = NULL;
+ char *t;
+
assert(c && m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
@@ -194,8 +196,8 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->get_latency = get_latency_cb;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("Unix FIFO sink '%s'", p);
- assert(u->sink->description);
+ pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Unix FIFO sink '%s'", p));
+ pa_xfree(t);
u->io = pa_iochannel_new(c->mainloop, -1, fd);
assert(u->io);
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index f2f214c7..5caa60a3 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -126,6 +126,8 @@ int pa__init(pa_core *c, pa_module*m) {
pa_sample_spec ss;
pa_channel_map map;
pa_modargs *ma = NULL;
+ char *t;
+
assert(c && m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
@@ -169,8 +171,8 @@ int pa__init(pa_core *c, pa_module*m) {
}
u->source->userdata = u;
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("Unix FIFO source '%s'", p);
- assert(u->source->description);
+ pa_source_set_description(u->source, t = pa_sprintf_malloc("Unix FIFO source '%s'", p));
+ pa_xfree(t);
u->io = pa_iochannel_new(c->mainloop, fd, -1);
assert(u->io);
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 02ef4bc4..21a72b38 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -500,6 +500,7 @@ int pa__init(pa_core *c, pa_module*m) {
pa_channel_map map;
pa_modargs *ma = NULL;
struct timeval tv;
+ char *t;
assert(c && m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
@@ -554,7 +555,8 @@ int pa__init(pa_core *c, pa_module*m) {
u->source->get_hw_volume = source_get_hw_volume_cb;
u->source->set_hw_volume = source_set_hw_volume_cb;
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("Solaris PCM on '%s'", p);
+ pa_source_set_description(u->source, t = pa_sprintf_malloc("Solaris PCM on '%s'", p));
+ pa_xfree(t);
u->source->is_hardware = 1;
} else
u->source = NULL;
@@ -569,7 +571,8 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->set_hw_mute = sink_set_hw_mute_cb;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("Solaris PCM on '%s'", p);
+ pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Solaris PCM on '%s'", p));
+ pa_xfree(t);
u->sink->is_hardware = 1;
} else
u->sink = NULL;
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 2fb34d12..9bb11c09 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -859,6 +859,8 @@ int pa__init(pa_core *c, pa_module*m) {
pa_sample_spec ss;
pa_channel_map map;
struct timeval ntv;
+ char *t;
+
assert(c && m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
@@ -925,7 +927,8 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->get_hw_mute = sink_get_hw_mute;
u->sink->set_hw_mute = sink_set_hw_mute;
u->sink->userdata = u;
- u->sink->description = pa_sprintf_malloc("Tunnel to '%s%s%s'", u->sink_name ? u->sink_name : "", u->sink_name ? "@" : "", u->server_name);
+ pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Tunnel to '%s%s%s'", u->sink_name ? u->sink_name : "", u->sink_name ? "@" : "", u->server_name));
+ pa_xfree(t);
pa_sink_set_owner(u->sink, m);
#else
@@ -940,7 +943,9 @@ int pa__init(pa_core *c, pa_module*m) {
u->source->get_hw_mute = source_get_hw_mute;
u->source->set_hw_mute = source_set_hw_mute;
u->source->userdata = u;
- u->source->description = pa_sprintf_malloc("Tunnel to '%s%s%s'", u->source_name ? u->source_name : "", u->source_name ? "@" : "", u->server_name);
+
+ pa_source_set_description(u->source, t = pa_sprintf_malloc("Tunnel to '%s%s%s'", u->source_name ? u->source_name : "", u->source_name ? "@" : "", u->server_name));
+ pa_xfree(t);
pa_source_set_owner(u->source, m);
#endif
diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c
index 8fd60b6a..27e8de58 100644
--- a/src/modules/module-waveout.c
+++ b/src/modules/module-waveout.c
@@ -503,7 +503,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->source->notify = notify_source_cb;
u->source->get_latency = source_get_latency_cb;
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("Windows waveIn PCM");
+ pa_source_set_description(u->source, "Windows waveIn PCM");
u->source->is_hardware = 1;
} else
u->source = NULL;
@@ -517,7 +517,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->sink->set_hw_volume = sink_set_hw_volume_cb;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("Windows waveOut PCM");
+ pa_sink_set_description(u->sink, "Windows waveOut PCM");
u->sink->is_hardware = 1;
} else
u->sink = NULL;
diff --git a/src/modules/module-zeroconf-publish.c b/src/modules/module-zeroconf-publish.c
index 23a188b3..16315d35 100644
--- a/src/modules/module-zeroconf-publish.c
+++ b/src/modules/module-zeroconf-publish.c
@@ -185,7 +185,8 @@ static int publish_service(struct userdata *u, struct service *s) {
txt = avahi_string_list_add_printf(txt, "rate=%u", ss.rate);
txt = avahi_string_list_add_printf(txt, "channels=%u", ss.channels);
txt = avahi_string_list_add_pair(txt, "format", pa_sample_format_to_string(ss.format));
- txt = avahi_string_list_add_pair(txt, "description", description);
+ if (description)
+ txt = avahi_string_list_add_pair(txt, "description", description);
type = s->loaded.type;
} else if (s->autoload.valid)