[pulseaudio-commits] r1205 - /trunk/src/modules/

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Aug 11 16:58:58 PDT 2006


Author: lennart
Date: Sat Aug 12 01:58:55 2006
New Revision: 1205

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1205&root=pulseaudio&view=rev
Log:
don't set the sink/source descriptions manually, use the new functions pa_{sink,source}_set_description() instead

Modified:
    trunk/src/modules/module-alsa-sink.c
    trunk/src/modules/module-alsa-source.c
    trunk/src/modules/module-combine.c
    trunk/src/modules/module-esound-sink.c
    trunk/src/modules/module-jack-sink.c
    trunk/src/modules/module-jack-source.c
    trunk/src/modules/module-null-sink.c
    trunk/src/modules/module-oss-mmap.c
    trunk/src/modules/module-oss.c
    trunk/src/modules/module-pipe-sink.c
    trunk/src/modules/module-pipe-source.c
    trunk/src/modules/module-solaris.c
    trunk/src/modules/module-tunnel.c
    trunk/src/modules/module-waveout.c
    trunk/src/modules/module-zeroconf-publish.c

Modified: trunk/src/modules/module-alsa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-alsa-sink.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-alsa-sink.c (original)
+++ trunk/src/modules/module-alsa-sink.c Sat Aug 12 01:58:55 2006
@@ -366,7 +366,8 @@
     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 @@
     }
     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);

Modified: trunk/src/modules/module-alsa-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-alsa-source.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-alsa-source.c (original)
+++ trunk/src/modules/module-alsa-source.c Sat Aug 12 01:58:55 2006
@@ -359,6 +359,7 @@
     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 @@
         }
     }
     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);

Modified: trunk/src/modules/module-combine.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-combine.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-combine.c (original)
+++ trunk/src/modules/module-combine.c Sat Aug 12 01:58:55 2006
@@ -381,7 +381,7 @@
     }
 
     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;
     

Modified: trunk/src/modules/module-esound-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-esound-sink.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-esound-sink.c (original)
+++ trunk/src/modules/module-esound-sink.c Sat Aug 12 01:58:55 2006
@@ -320,6 +320,8 @@
     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 @@
     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;

Modified: trunk/src/modules/module-jack-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-jack-sink.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-jack-sink.c (original)
+++ trunk/src/modules/module-jack-sink.c Sat Aug 12 01:58:55 2006
@@ -245,6 +245,7 @@
     int do_connect = 1;
     unsigned i;
     const char **ports = NULL, **p;
+    char *t;
     
     assert(c);
     assert(m);
@@ -328,7 +329,8 @@
 
     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);

Modified: trunk/src/modules/module-jack-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-jack-source.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-jack-source.c (original)
+++ trunk/src/modules/module-jack-source.c Sat Aug 12 01:58:55 2006
@@ -243,6 +243,7 @@
     int do_connect = 1;
     unsigned i;
     const char **ports = NULL, **p;
+    char *t;
     
     assert(c);
     assert(m);
@@ -326,7 +327,8 @@
 
     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);

Modified: trunk/src/modules/module-null-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-null-sink.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-null-sink.c (original)
+++ trunk/src/modules/module-null-sink.c Sat Aug 12 01:58:55 2006
@@ -141,7 +141,7 @@
     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);

Modified: trunk/src/modules/module-oss-mmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss-mmap.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-oss-mmap.c (original)
+++ trunk/src/modules/module-oss-mmap.c Sat Aug 12 01:58:55 2006
@@ -349,7 +349,7 @@
     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 @@
             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 @@
             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);

Modified: trunk/src/modules/module-oss.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-oss.c (original)
+++ trunk/src/modules/module-oss.c Sat Aug 12 01:58:55 2006
@@ -326,7 +326,7 @@
     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 @@
         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 @@
         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;

Modified: trunk/src/modules/module-pipe-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-pipe-sink.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-pipe-sink.c (original)
+++ trunk/src/modules/module-pipe-sink.c Sat Aug 12 01:58:55 2006
@@ -148,6 +148,8 @@
     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 @@
     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);

Modified: trunk/src/modules/module-pipe-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-pipe-source.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-pipe-source.c (original)
+++ trunk/src/modules/module-pipe-source.c Sat Aug 12 01:58:55 2006
@@ -126,6 +126,8 @@
     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 @@
     }
     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);

Modified: trunk/src/modules/module-solaris.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-solaris.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-solaris.c (original)
+++ trunk/src/modules/module-solaris.c Sat Aug 12 01:58:55 2006
@@ -500,6 +500,7 @@
     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 @@
         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 @@
         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;

Modified: trunk/src/modules/module-tunnel.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-tunnel.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-tunnel.c (original)
+++ trunk/src/modules/module-tunnel.c Sat Aug 12 01:58:55 2006
@@ -859,6 +859,8 @@
     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 @@
     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 @@
     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

Modified: trunk/src/modules/module-waveout.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-waveout.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-waveout.c (original)
+++ trunk/src/modules/module-waveout.c Sat Aug 12 01:58:55 2006
@@ -503,7 +503,7 @@
         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 @@
         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;

Modified: trunk/src/modules/module-zeroconf-publish.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-zeroconf-publish.c?rev=1205&root=pulseaudio&r1=1204&r2=1205&view=diff
==============================================================================
--- trunk/src/modules/module-zeroconf-publish.c (original)
+++ trunk/src/modules/module-zeroconf-publish.c Sat Aug 12 01:58:55 2006
@@ -185,7 +185,8 @@
             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)




More information about the pulseaudio-commits mailing list