2004-07-16 19:56:36 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
|
/***
|
2006-06-19 21:53:48 +00:00
|
|
|
This file is part of PulseAudio.
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-02-13 15:35:19 +00:00
|
|
|
Copyright 2004-2006 Lennart Poettering
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
2004-11-14 14:58:54 +00:00
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
2004-07-16 19:56:36 +00:00
|
|
|
by the Free Software Foundation; either version 2 of the License,
|
|
|
|
|
or (at your option) any later version.
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is distributed in the hope that it will be useful, but
|
2004-07-16 19:56:36 +00:00
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
General Public License for more details.
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2004-11-14 14:58:54 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2006-06-19 21:53:48 +00:00
|
|
|
along with PulseAudio; if not, write to the Free Software
|
2004-07-16 19:56:36 +00:00
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2004-07-16 19:16:42 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <limits.h>
|
2007-06-13 22:08:14 +00:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
#include <sys/poll.h>
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
#include <pulse/xmalloc.h>
|
2006-05-17 16:34:18 +00:00
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
#include <pulsecore/core-error.h>
|
|
|
|
|
#include <pulsecore/sink.h>
|
|
|
|
|
#include <pulsecore/module.h>
|
|
|
|
|
#include <pulsecore/core-util.h>
|
|
|
|
|
#include <pulsecore/modargs.h>
|
|
|
|
|
#include <pulsecore/log.h>
|
2007-06-13 22:08:14 +00:00
|
|
|
#include <pulsecore/thread.h>
|
2006-02-16 19:19:58 +00:00
|
|
|
|
2004-10-30 01:55:16 +00:00
|
|
|
#include "module-pipe-sink-symdef.h"
|
2004-07-11 16:59:22 +00:00
|
|
|
|
2004-09-11 23:17:38 +00:00
|
|
|
PA_MODULE_AUTHOR("Lennart Poettering")
|
|
|
|
|
PA_MODULE_DESCRIPTION("UNIX pipe sink")
|
|
|
|
|
PA_MODULE_VERSION(PACKAGE_VERSION)
|
2006-04-26 15:40:14 +00:00
|
|
|
PA_MODULE_USAGE(
|
|
|
|
|
"sink_name=<name for the sink> "
|
|
|
|
|
"file=<path of the FIFO> "
|
|
|
|
|
"format=<sample format> "
|
|
|
|
|
"channels=<number of channels> "
|
|
|
|
|
"rate=<sample rate>"
|
|
|
|
|
"channel_map=<channel map>")
|
2004-09-11 23:17:38 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
#define DEFAULT_FILE_NAME "/tmp/music.output"
|
2004-07-11 16:59:22 +00:00
|
|
|
#define DEFAULT_SINK_NAME "fifo_output"
|
2004-06-08 23:54:24 +00:00
|
|
|
|
|
|
|
|
struct userdata {
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_core *core;
|
|
|
|
|
pa_module *module;
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_sink *sink;
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_thread *thread;
|
|
|
|
|
pa_asyncmsgq *asyncmsgq;
|
2007-06-11 12:08:37 +00:00
|
|
|
char *filename;
|
|
|
|
|
int fd;
|
2007-06-13 22:08:14 +00:00
|
|
|
|
|
|
|
|
pa_memchunk memchunk;
|
2004-06-08 23:54:24 +00:00
|
|
|
};
|
|
|
|
|
|
2004-07-11 16:59:22 +00:00
|
|
|
static const char* const valid_modargs[] = {
|
|
|
|
|
"file",
|
|
|
|
|
"rate",
|
|
|
|
|
"format",
|
2004-09-20 17:19:35 +00:00
|
|
|
"channels",
|
2004-07-11 23:21:32 +00:00
|
|
|
"sink_name",
|
2006-04-26 15:40:14 +00:00
|
|
|
"channel_map",
|
2004-07-11 16:59:22 +00:00
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
static int sink_process_msg(pa_msgobject *o, int code, void *data, pa_memchunk *chunk) {
|
|
|
|
|
struct userdata *u = PA_SINK(o)->userdata;
|
|
|
|
|
|
|
|
|
|
switch (code) {
|
|
|
|
|
|
|
|
|
|
case PA_SINK_MESSAGE_GET_LATENCY: {
|
|
|
|
|
size_t n = 0;
|
|
|
|
|
int l;
|
|
|
|
|
|
|
|
|
|
if (ioctl(u->fd, TIOCINQ, &l) >= 0 && l > 0)
|
|
|
|
|
n = (size_t) l;
|
|
|
|
|
|
|
|
|
|
n += u->memchunk.length;
|
|
|
|
|
|
|
|
|
|
*((pa_usec_t*) data) = pa_bytes_to_usec(n, &u->sink->sample_spec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return pa_sink_process_msg(o, code, data, chunk);
|
|
|
|
|
}
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
static void thread_func(void *userdata) {
|
2007-06-13 22:08:14 +00:00
|
|
|
enum {
|
|
|
|
|
POLLFD_ASYNCQ,
|
|
|
|
|
POLLFD_FIFO,
|
|
|
|
|
POLLFD_MAX,
|
|
|
|
|
};
|
|
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
struct userdata *u = userdata;
|
|
|
|
|
struct pollfd pollfd[POLLFD_MAX];
|
2007-06-13 22:08:14 +00:00
|
|
|
int write_type = 0;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_assert(u);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_log_debug("Thread starting up");
|
|
|
|
|
|
|
|
|
|
memset(&pollfd, 0, sizeof(pollfd));
|
2007-06-13 22:08:14 +00:00
|
|
|
|
|
|
|
|
pollfd[POLLFD_ASYNCQ].fd = pa_asyncmsgq_get_fd(u->asyncmsgq);
|
2007-06-11 12:08:37 +00:00
|
|
|
pollfd[POLLFD_ASYNCQ].events = POLLIN;
|
|
|
|
|
pollfd[POLLFD_FIFO].fd = u->fd;
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
for (;;) {
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_msgobject *object;
|
2007-06-11 12:08:37 +00:00
|
|
|
int code;
|
2007-06-13 22:08:14 +00:00
|
|
|
void *data;
|
|
|
|
|
pa_memchunk chunk;
|
2007-06-11 12:08:37 +00:00
|
|
|
int r;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
/* Check whether there is a message for us to process */
|
2007-06-13 22:08:14 +00:00
|
|
|
if (pa_asyncmsgq_get(u->asyncmsgq, &object, &code, &data, &chunk, 0) == 0) {
|
|
|
|
|
int ret;
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
if (!object && code == PA_MESSAGE_SHUTDOWN) {
|
|
|
|
|
pa_asyncmsgq_done(u->asyncmsgq, 0);
|
|
|
|
|
goto finish;
|
2007-06-11 12:08:37 +00:00
|
|
|
}
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
ret = pa_asyncmsgq_dispatch(object, code, data, &chunk);
|
|
|
|
|
pa_asyncmsgq_done(u->asyncmsgq, ret);
|
2007-06-11 12:08:37 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Render some data and write it to the fifo */
|
|
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
if (u->sink->thread_info.state == PA_SINK_RUNNING && pollfd[POLLFD_FIFO].revents) {
|
|
|
|
|
ssize_t l;
|
|
|
|
|
void *p;
|
2007-06-11 12:08:37 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
if (u->memchunk.length <= 0)
|
|
|
|
|
pa_sink_render(u->sink, PIPE_BUF, &u->memchunk);
|
2007-06-11 12:08:37 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
pa_assert(u->memchunk.length > 0);
|
2007-06-11 12:08:37 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
p = pa_memblock_acquire(u->memchunk.memblock);
|
|
|
|
|
l = pa_write(u->fd, (uint8_t*) p + u->memchunk.index, u->memchunk.length, &write_type);
|
|
|
|
|
pa_memblock_release(u->memchunk.memblock);
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
pa_assert(l != 0);
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
if (l < 0) {
|
2007-06-11 12:08:37 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
if (errno == EINTR)
|
|
|
|
|
continue;
|
|
|
|
|
else if (errno != EAGAIN) {
|
|
|
|
|
pa_log("Failed to write data to FIFO: %s", pa_cstrerror(errno));
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
} else {
|
2007-06-11 12:08:37 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
u->memchunk.index += l;
|
|
|
|
|
u->memchunk.length -= l;
|
2007-06-11 12:08:37 +00:00
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
if (u->memchunk.length <= 0) {
|
|
|
|
|
pa_memblock_unref(u->memchunk.memblock);
|
|
|
|
|
pa_memchunk_reset(&u->memchunk);
|
2007-06-13 22:08:14 +00:00
|
|
|
}
|
2007-06-23 20:03:30 +00:00
|
|
|
|
|
|
|
|
pollfd[POLLFD_FIFO].revents = 0;
|
|
|
|
|
continue;
|
2007-06-11 12:08:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
pollfd[POLLFD_FIFO].events = u->sink->thread_info.state == PA_SINK_RUNNING ? POLLOUT : 0;
|
2007-06-11 12:08:37 +00:00
|
|
|
|
|
|
|
|
/* Hmm, nothing to do. Let's sleep */
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
if (pa_asyncmsgq_before_poll(u->asyncmsgq) < 0)
|
2007-06-11 12:08:37 +00:00
|
|
|
continue;
|
|
|
|
|
|
2007-06-23 20:03:30 +00:00
|
|
|
/* pa_log("polling for %u", pollfd[POLLFD_FIFO].events); */
|
2007-06-13 22:08:14 +00:00
|
|
|
r = poll(pollfd, POLLFD_MAX, -1);
|
2007-06-14 16:53:40 +00:00
|
|
|
/* pa_log("polling got %u", r > 0 ? pollfd[POLLFD_FIFO].revents : 0); */
|
|
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_asyncmsgq_after_poll(u->asyncmsgq);
|
2007-06-11 12:08:37 +00:00
|
|
|
|
|
|
|
|
if (r < 0) {
|
2007-07-12 16:15:35 +00:00
|
|
|
if (errno == EINTR) {
|
|
|
|
|
pollfd[POLLFD_ASYNCQ].revents = 0;
|
|
|
|
|
pollfd[POLLFD_FIFO].revents = 0;
|
2007-06-11 12:08:37 +00:00
|
|
|
continue;
|
2007-07-12 16:15:35 +00:00
|
|
|
}
|
2007-06-11 12:08:37 +00:00
|
|
|
|
|
|
|
|
pa_log("poll() failed: %s", pa_cstrerror(errno));
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
if (pollfd[POLLFD_FIFO].revents & ~POLLOUT) {
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_log("FIFO shutdown.");
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_assert((pollfd[POLLFD_ASYNCQ].revents & ~POLLIN) == 0);
|
2004-06-08 23:54:24 +00:00
|
|
|
}
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
fail:
|
|
|
|
|
/* We have to continue processing messages until we receive the
|
|
|
|
|
* SHUTDOWN message */
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_asyncmsgq_post(u->core->asyncmsgq, PA_MSGOBJECT(u->core), PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, NULL, NULL);
|
|
|
|
|
pa_asyncmsgq_wait_for(u->asyncmsgq, PA_MESSAGE_SHUTDOWN);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
finish:
|
|
|
|
|
pa_log_debug("Thread shutting down");
|
2004-06-08 23:54:24 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa__init(pa_core *c, pa_module*m) {
|
2007-06-14 16:53:40 +00:00
|
|
|
struct userdata *u;
|
2004-06-08 23:54:24 +00:00
|
|
|
struct stat st;
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_sample_spec ss;
|
2006-04-26 15:40:14 +00:00
|
|
|
pa_channel_map map;
|
2007-06-14 16:53:40 +00:00
|
|
|
pa_modargs *ma;
|
2006-08-11 23:58:55 +00:00
|
|
|
char *t;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_assert(c);
|
|
|
|
|
pa_assert(m);
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2004-07-11 16:59:22 +00:00
|
|
|
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_log("Failed to parse module arguments.");
|
2004-07-11 16:59:22 +00:00
|
|
|
goto fail;
|
|
|
|
|
}
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-15 20:12:21 +00:00
|
|
|
ss = c->default_sample_spec;
|
2006-05-16 23:47:38 +00:00
|
|
|
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANNEL_MAP_DEFAULT) < 0) {
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_log("Invalid sample format specification or channel map");
|
2004-07-11 16:59:22 +00:00
|
|
|
goto fail;
|
|
|
|
|
}
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
u = pa_xnew0(struct userdata, 1);
|
|
|
|
|
u->core = c;
|
|
|
|
|
u->module = m;
|
|
|
|
|
m->userdata = u;
|
2007-06-23 20:03:30 +00:00
|
|
|
pa_memchunk_reset(&u->memchunk);
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_assert_se(u->asyncmsgq = pa_asyncmsgq_new(0));
|
|
|
|
|
|
|
|
|
|
u->filename = pa_xstrdup(pa_modargs_get_value(ma, "file", DEFAULT_FILE_NAME));
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
mkfifo(u->filename, 0666);
|
|
|
|
|
if ((u->fd = open(u->filename, O_RDWR|O_NOCTTY)) < 0) {
|
|
|
|
|
pa_log("open('%s'): %s", u->filename, pa_cstrerror(errno));
|
2004-06-08 23:54:24 +00:00
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_fd_set_cloexec(u->fd, 1);
|
|
|
|
|
pa_make_nonblock_fd(u->fd);
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
if (fstat(u->fd, &st) < 0) {
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_log("fstat('%s'): %s", u->filename, pa_cstrerror(errno));
|
2004-06-08 23:54:24 +00:00
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!S_ISFIFO(st.st_mode)) {
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_log("'%s' is not a FIFO.", u->filename);
|
2004-06-08 23:54:24 +00:00
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
2006-04-26 15:40:14 +00:00
|
|
|
if (!(u->sink = pa_sink_new(c, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss, &map))) {
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_log("Failed to create sink.");
|
2004-07-11 16:59:22 +00:00
|
|
|
goto fail;
|
|
|
|
|
}
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
u->sink->parent.process_msg = sink_process_msg;
|
2004-06-15 17:05:03 +00:00
|
|
|
u->sink->userdata = u;
|
2007-06-13 22:08:14 +00:00
|
|
|
|
|
|
|
|
pa_sink_set_module(u->sink, m);
|
|
|
|
|
pa_sink_set_asyncmsgq(u->sink, u->asyncmsgq);
|
|
|
|
|
pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Unix FIFO sink '%s'", u->filename));
|
2006-08-11 23:58:55 +00:00
|
|
|
pa_xfree(t);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
if (!(u->thread = pa_thread_new(thread_func, u))) {
|
|
|
|
|
pa_log("Failed to create thread.");
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2004-07-11 16:59:22 +00:00
|
|
|
pa_modargs_free(ma);
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
fail:
|
2004-07-11 16:59:22 +00:00
|
|
|
if (ma)
|
|
|
|
|
pa_modargs_free(ma);
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2004-09-11 23:17:38 +00:00
|
|
|
pa__done(c, m);
|
2004-07-11 16:59:22 +00:00
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
void pa__done(pa_core *c, pa_module*m) {
|
2004-06-08 23:54:24 +00:00
|
|
|
struct userdata *u;
|
2007-06-13 22:08:14 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_assert(c);
|
|
|
|
|
pa_assert(m);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-11 16:59:22 +00:00
|
|
|
if (!(u = m->userdata))
|
|
|
|
|
return;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
if (u->sink)
|
|
|
|
|
pa_sink_disconnect(u->sink);
|
2007-06-11 12:08:37 +00:00
|
|
|
|
|
|
|
|
if (u->thread) {
|
2007-06-13 22:08:14 +00:00
|
|
|
pa_asyncmsgq_send(u->asyncmsgq, NULL, PA_MESSAGE_SHUTDOWN, NULL, NULL);
|
2007-06-11 12:08:37 +00:00
|
|
|
pa_thread_free(u->thread);
|
|
|
|
|
}
|
2007-06-11 12:17:40 +00:00
|
|
|
|
2007-06-13 22:08:14 +00:00
|
|
|
if (u->asyncmsgq)
|
|
|
|
|
pa_asyncmsgq_free(u->asyncmsgq);
|
|
|
|
|
|
|
|
|
|
if (u->sink)
|
|
|
|
|
pa_sink_unref(u->sink);
|
2004-06-14 22:47:12 +00:00
|
|
|
|
2007-06-11 12:08:37 +00:00
|
|
|
if (u->memchunk.memblock)
|
|
|
|
|
pa_memblock_unref(u->memchunk.memblock);
|
|
|
|
|
|
|
|
|
|
if (u->filename) {
|
|
|
|
|
unlink(u->filename);
|
|
|
|
|
pa_xfree(u->filename);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (u->fd >= 0)
|
|
|
|
|
close(u->fd);
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2004-08-04 16:39:30 +00:00
|
|
|
pa_xfree(u);
|
2004-06-08 23:54:24 +00:00
|
|
|
}
|