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.
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.
#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")
#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;
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;
}
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;
}
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;