]> code.delx.au - pulseaudio/blobdiff - polyp/module-null-sink.c
Merge Pierre's changes
[pulseaudio] / polyp / module-null-sink.c
index e48e966873d4b3ed3850bddbcc912413837f4921..6c7a44f289c355af49363b6a3e43b7d9b1f259b6 100644 (file)
@@ -4,7 +4,7 @@
   This file is part of polypaudio.
  
   polypaudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published
+  it under the terms of the GNU Lesser General Public License as published
   by the Free Software Foundation; either version 2 of the License,
   or (at your option) any later version.
  
@@ -13,7 +13,7 @@
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.
  
-  You should have received a copy of the GNU General Public License
+  You should have received a copy of the GNU Lesser General Public License
   along with polypaudio; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
   USA.
@@ -40,6 +40,7 @@
 #include "modargs.h"
 #include "xmalloc.h"
 #include "log.h"
+#include "module-null-sink-symdef.h"
 
 PA_MODULE_AUTHOR("Lennart Poettering")
 PA_MODULE_DESCRIPTION("Clocked NULL sink")
@@ -48,6 +49,8 @@ PA_MODULE_USAGE("format=<sample format> channels=<number of channels> rate=<samp
 
 #define DEFAULT_SINK_NAME "null"
 
+#define PA_TYPEID_NULL PA_TYPEID_MAKE('N', 'U', 'L', 'L')
+
 struct userdata {
     struct pa_core *core;
     struct pa_module *module;
@@ -90,13 +93,13 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
     assert(c && m);
     
     if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
-        pa_log(__FILE__": failed to parse module arguments\n");
+        pa_log(__FILE__": failed to parse module arguments.\n");
         goto fail;
     }
 
     ss = c->default_sample_spec;
     if (pa_modargs_get_sample_spec(ma, &ss) < 0) {
-        pa_log(__FILE__": invalid sample format specification\n");
+        pa_log(__FILE__": invalid sample format specification.\n");
         goto fail;
     }
     
@@ -105,7 +108,7 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
     u->module = m;
     m->userdata = u;
     
-    if (!(u->sink = pa_sink_new(c, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss))) {
+    if (!(u->sink = pa_sink_new(c, PA_TYPEID_NULL, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss))) {
         pa_log(__FILE__": failed to create sink.\n");
         goto fail;
     }
@@ -114,7 +117,7 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
     pa_sink_set_owner(u->sink, m);
     u->sink->description = pa_sprintf_malloc("NULL sink");
 
-    gettimeofday(&tv, NULL);
+    pa_gettimeofday(&tv);
     u->time_event = c->mainloop->time_new(c->mainloop, &tv, time_callback, u);
 
     u->block_size = pa_bytes_per_second(&ss) / 10;