mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
fix downsampling/resampling add support for U8 samples git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@49 fefdeb5f-60dc-0310-8127-8f9354f1896f
35 lines
817 B
C
35 lines
817 B
C
#include <stdio.h>
|
|
#include <assert.h>
|
|
#include <unistd.h>
|
|
|
|
#include "main.h"
|
|
#include "module.h"
|
|
#include "iochannel.h"
|
|
#include "cli.h"
|
|
|
|
int module_init(struct pa_core *c, struct pa_module*m) {
|
|
struct pa_iochannel *io;
|
|
assert(c && m);
|
|
|
|
if (pa_stdin_inuse || pa_stdout_inuse) {
|
|
fprintf(stderr, "STDIN/STDUSE already used\n");
|
|
return -1;
|
|
}
|
|
|
|
pa_stdin_inuse = pa_stdout_inuse = 1;
|
|
io = pa_iochannel_new(c->mainloop, STDIN_FILENO, STDOUT_FILENO);
|
|
assert(io);
|
|
pa_iochannel_set_noclose(io, 1);
|
|
|
|
m->userdata = pa_cli_new(c, io);
|
|
assert(m->userdata);
|
|
return 0;
|
|
}
|
|
|
|
void module_done(struct pa_core *c, struct pa_module*m) {
|
|
assert(c && m);
|
|
|
|
pa_cli_free(m->userdata);
|
|
assert(pa_stdin_inuse && pa_stdout_inuse);
|
|
pa_stdin_inuse = pa_stdout_inuse = 0;
|
|
}
|