Kill spaces on EOL

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1465 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-05-29 17:24:48 +00:00
parent e4d63d0d80
commit 1e12e0ee8d
21 changed files with 2721 additions and 2721 deletions

View file

@ -126,7 +126,7 @@ pulseaudio_SOURCES = \
pulsecore/gccmacro.h pulsecore/gccmacro.h
pulseaudio_CFLAGS = $(AM_CFLAGS) $(LIBOIL_CFLAGS) pulseaudio_CFLAGS = $(AM_CFLAGS) $(LIBOIL_CFLAGS)
pulseaudio_CPPFLAGS = $(AM_CPPFLAGS) pulseaudio_CPPFLAGS = $(AM_CPPFLAGS)
pulseaudio_LDADD = $(AM_LDADD) libpulsecore.la $(LIBLTDL) \ pulseaudio_LDADD = $(AM_LDADD) libpulsecore.la $(LIBLTDL) \
$(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS) $(CAP_LIBS) $(LIBOIL_LIBS) $(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS) $(CAP_LIBS) $(LIBOIL_LIBS)
# This is needed because automake doesn't properly expand the foreach below # This is needed because automake doesn't properly expand the foreach below
@ -168,8 +168,8 @@ endif
bin_SCRIPTS = esdcompat bin_SCRIPTS = esdcompat
pacat_SOURCES = utils/pacat.c pacat_SOURCES = utils/pacat.c
pacat_LDADD = $(AM_LDADD) libpulse.la pacat_LDADD = $(AM_LDADD) libpulse.la
pacat_CFLAGS = $(AM_CFLAGS) pacat_CFLAGS = $(AM_CFLAGS)
pacat_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) pacat_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
paplay_SOURCES = utils/paplay.c paplay_SOURCES = utils/paplay.c
@ -247,7 +247,7 @@ utf8_test_CFLAGS = $(AM_CFLAGS)
utf8_test_LDADD = $(AM_LDADD) libpulsecore.la utf8_test_LDADD = $(AM_LDADD) libpulsecore.la
utf8_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) utf8_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
get_binary_name_test_SOURCES = tests/get-binary-name-test.c get_binary_name_test_SOURCES = tests/get-binary-name-test.c
get_binary_name_test_CFLAGS = $(AM_CFLAGS) get_binary_name_test_CFLAGS = $(AM_CFLAGS)
get_binary_name_test_LDADD = $(AM_LDADD) libpulse.la get_binary_name_test_LDADD = $(AM_LDADD) libpulse.la
get_binary_name_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) get_binary_name_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
@ -264,22 +264,22 @@ hook_list_test_CFLAGS = $(AM_CFLAGS)
hook_list_test_LDADD = $(AM_LDADD) libpulsecore.la hook_list_test_LDADD = $(AM_LDADD) libpulsecore.la
hook_list_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) hook_list_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
memblock_test_SOURCES = tests/memblock-test.c memblock_test_SOURCES = tests/memblock-test.c
memblock_test_CFLAGS = $(AM_CFLAGS) memblock_test_CFLAGS = $(AM_CFLAGS)
memblock_test_LDADD = $(AM_LDADD) libpulsecore.la memblock_test_LDADD = $(AM_LDADD) libpulsecore.la
memblock_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) memblock_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
thread_test_SOURCES = tests/thread-test.c thread_test_SOURCES = tests/thread-test.c
thread_test_CFLAGS = $(AM_CFLAGS) thread_test_CFLAGS = $(AM_CFLAGS)
thread_test_LDADD = $(AM_LDADD) libpulsecore.la thread_test_LDADD = $(AM_LDADD) libpulsecore.la
thread_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) thread_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
flist_test_SOURCES = tests/flist-test.c \ flist_test_SOURCES = tests/flist-test.c \
pulsecore/atomic.h \ pulsecore/atomic.h \
pulsecore/flist.c pulsecore/flist.h pulsecore/flist.c pulsecore/flist.h
flist_test_CFLAGS = $(AM_CFLAGS) flist_test_CFLAGS = $(AM_CFLAGS)
flist_test_LDADD = $(AM_LDADD) libpulsecore.la flist_test_LDADD = $(AM_LDADD) libpulsecore.la
flist_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) flist_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
mcalign_test_SOURCES = tests/mcalign-test.c mcalign_test_SOURCES = tests/mcalign-test.c
mcalign_test_CFLAGS = $(AM_CFLAGS) mcalign_test_CFLAGS = $(AM_CFLAGS)
@ -333,12 +333,12 @@ memblockq_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
sync_playback_SOURCES = tests/sync-playback.c sync_playback_SOURCES = tests/sync-playback.c
sync_playback_LDADD = $(AM_LDADD) libpulse.la sync_playback_LDADD = $(AM_LDADD) libpulse.la
sync_playback_CFLAGS = $(AM_CFLAGS) sync_playback_CFLAGS = $(AM_CFLAGS)
sync_playback_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) sync_playback_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
interpol_test_SOURCES = tests/interpol-test.c interpol_test_SOURCES = tests/interpol-test.c
interpol_test_LDADD = $(AM_LDADD) libpulse.la interpol_test_LDADD = $(AM_LDADD) libpulse.la
interpol_test_CFLAGS = $(AM_CFLAGS) interpol_test_CFLAGS = $(AM_CFLAGS)
interpol_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) interpol_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
################################### ###################################
@ -459,7 +459,7 @@ libpulse_la_SOURCES += \
if OS_IS_WIN32 if OS_IS_WIN32
libpulse_la_SOURCES += \ libpulse_la_SOURCES += \
pulsecore/dllmain.c pulsecore/dllmain.c
endif endif
if HAVE_X11 if HAVE_X11
@ -482,7 +482,7 @@ libpulse_la_CFLAGS += $(LIBASYNCNS_CFLAGS)
libpulse_la_LIBADD += $(LIBASYNCNS_LIBS) libpulse_la_LIBADD += $(LIBASYNCNS_LIBS)
endif endif
libpulse_simple_la_SOURCES = pulse/simple.c pulse/simple.h libpulse_simple_la_SOURCES = pulse/simple.c pulse/simple.h
libpulse_simple_la_CFLAGS = $(AM_CFLAGS) libpulse_simple_la_CFLAGS = $(AM_CFLAGS)
libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la
libpulse_simple_la_LDFLAGS = -version-info $(LIBPULSE_SIMPLE_VERSION_INFO) libpulse_simple_la_LDFLAGS = -version-info $(LIBPULSE_SIMPLE_VERSION_INFO)
@ -640,7 +640,7 @@ libpulsecore_la_SOURCES += \
if OS_IS_WIN32 if OS_IS_WIN32
libpulsecore_la_SOURCES += \ libpulsecore_la_SOURCES += \
pulsecore/dllmain.c pulsecore/dllmain.c
endif endif
libpulsecore_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBOIL_CFLAGS) libpulsecore_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBOIL_CFLAGS)
@ -820,7 +820,7 @@ libsocket_util_la_SOURCES = \
libsocket_util_la_LDFLAGS = -avoid-version libsocket_util_la_LDFLAGS = -avoid-version
libsocket_util_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) libpulsecore.la libsocket_util_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) libpulsecore.la
librtp_la_SOURCES = modules/rtp/rtp.c modules/rtp/rtp.h modules/rtp/sdp.c modules/rtp/sdp.h modules/rtp/sap.c modules/rtp/sap.h librtp_la_SOURCES = modules/rtp/rtp.c modules/rtp/rtp.h modules/rtp/sdp.c modules/rtp/sdp.h modules/rtp/sap.c modules/rtp/sap.h
librtp_la_LDFLAGS = -avoid-version librtp_la_LDFLAGS = -avoid-version
librtp_la_LIBADD = $(AM_LIBADD) libpulsecore.la librtp_la_LIBADD = $(AM_LIBADD) libpulsecore.la
@ -1298,7 +1298,7 @@ esdcompat: daemon/esdcompat.in Makefile
client.conf: pulse/client.conf.in Makefile client.conf: pulse/client.conf.in Makefile
sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' < $< > $@ sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' < $< > $@
if OS_IS_WIN32 if OS_IS_WIN32
default.pa: daemon/default.pa.win32 default.pa: daemon/default.pa.win32
cp $< $@ cp $< $@
else else

View file

@ -97,9 +97,9 @@ int pa_limit_caps(void) {
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0)
goto fail; goto fail;
pa_log_info("dropped capabilities successfully."); pa_log_info("dropped capabilities successfully.");
r = 1; r = 1;
fail: fail:
@ -119,12 +119,12 @@ int pa_drop_caps(void) {
cap_clear(caps); cap_clear(caps);
prctl(PR_SET_KEEPCAPS, 0, 0, 0, 0); prctl(PR_SET_KEEPCAPS, 0, 0, 0, 0);
if (cap_set_proc(caps) < 0) { if (cap_set_proc(caps) < 0) {
pa_log("failed to drop capabilities: %s", pa_cstrerror(errno)); pa_log("failed to drop capabilities: %s", pa_cstrerror(errno));
goto fail; goto fail;
} }
r = 0; r = 0;
fail: fail:

View file

@ -4,17 +4,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@ -48,30 +48,30 @@ static void handle_module(GConfClient *client, const char *name) {
snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/enabled", name); snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/enabled", name);
enabled = gconf_client_get_bool(client, p, FALSE); enabled = gconf_client_get_bool(client, p, FALSE);
printf("%c%s%c", enabled ? '+' : '-', name, 0); printf("%c%s%c", enabled ? '+' : '-', name, 0);
if (enabled) { if (enabled) {
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
gchar *n, *a; gchar *n, *a;
snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/name%i", name, i); snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/name%i", name, i);
if (!(n = gconf_client_get_string(client, p, NULL)) || !*n) if (!(n = gconf_client_get_string(client, p, NULL)) || !*n)
break; break;
snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/args%i", name, i); snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/args%i", name, i);
a = gconf_client_get_string(client, p, NULL); a = gconf_client_get_string(client, p, NULL);
printf("%s%c%s%c", n, 0, a ? a : "", 0); printf("%s%c%s%c", n, 0, a ? a : "", 0);
g_free(n); g_free(n);
g_free(a); g_free(a);
} }
printf("%c", 0); printf("%c", 0);
} }
fflush(stdout); fflush(stdout);
} }
@ -83,7 +83,7 @@ static void modules_callback(
const char *n; const char *n;
char buf[128]; char buf[128];
g_assert(strncmp(entry->key, PA_GCONF_PATH_MODULES"/", sizeof(PA_GCONF_PATH_MODULES)) == 0); g_assert(strncmp(entry->key, PA_GCONF_PATH_MODULES"/", sizeof(PA_GCONF_PATH_MODULES)) == 0);
n = entry->key + sizeof(PA_GCONF_PATH_MODULES); n = entry->key + sizeof(PA_GCONF_PATH_MODULES);
@ -113,17 +113,17 @@ int main(int argc, char *argv[]) {
char *e = strrchr(m->data, '/'); char *e = strrchr(m->data, '/');
handle_module(client, e ? e+1 : m->data); handle_module(client, e ? e+1 : m->data);
} }
g_slist_free(modules); g_slist_free(modules);
/* Signal the parent that we are now initialized */ /* Signal the parent that we are now initialized */
printf("!"); printf("!");
fflush(stdout); fflush(stdout);
g = g_main_loop_new(NULL, FALSE); g = g_main_loop_new(NULL, FALSE);
g_main_loop_run(g); g_main_loop_run(g);
g_main_loop_unref(g); g_main_loop_unref(g);
g_object_unref(G_OBJECT(client)); g_object_unref(G_OBJECT(client));
return 0; return 0;

View file

@ -4,17 +4,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@ -80,7 +80,7 @@ struct module_info {
struct userdata { struct userdata {
pa_core *core; pa_core *core;
pa_module *module; pa_module *module;
pa_hashmap *module_infos; pa_hashmap *module_infos;
pid_t pid; pid_t pid;
@ -129,7 +129,7 @@ static char *read_string(struct userdata *u) {
for (;;) { for (;;) {
char *e; char *e;
if ((e = memchr(u->buf, 0, u->buf_fill))) { if ((e = memchr(u->buf, 0, u->buf_fill))) {
char *ret = pa_xstrdup(u->buf); char *ret = pa_xstrdup(u->buf);
u->buf_fill -= e - u->buf +1; u->buf_fill -= e - u->buf +1;
@ -149,7 +149,7 @@ static void unload_one_module(struct userdata *u, struct module_info*m, unsigned
if (m->items[i].index == PA_INVALID_INDEX) if (m->items[i].index == PA_INVALID_INDEX)
return; return;
pa_log_debug("Unloading module #%i", m->items[i].index); pa_log_debug("Unloading module #%i", m->items[i].index);
pa_module_unload_by_index(u->core, m->items[i].index); pa_module_unload_by_index(u->core, m->items[i].index);
m->items[i].index = PA_INVALID_INDEX; m->items[i].index = PA_INVALID_INDEX;
@ -160,7 +160,7 @@ static void unload_one_module(struct userdata *u, struct module_info*m, unsigned
static void unload_all_modules(struct userdata *u, struct module_info*m) { static void unload_all_modules(struct userdata *u, struct module_info*m) {
unsigned i; unsigned i;
assert(u); assert(u);
assert(m); assert(m);
@ -179,7 +179,7 @@ static void load_module(
int is_new) { int is_new) {
pa_module *mod; pa_module *mod;
assert(u); assert(u);
assert(m); assert(m);
assert(name); assert(name);
@ -193,18 +193,18 @@ static void load_module(
unload_one_module(u, m, i); unload_one_module(u, m, i);
} }
pa_log_debug("Loading module '%s' with args '%s' due to GConf configuration.", name, args); pa_log_debug("Loading module '%s' with args '%s' due to GConf configuration.", name, args);
m->items[i].name = pa_xstrdup(name); m->items[i].name = pa_xstrdup(name);
m->items[i].args = pa_xstrdup(args); m->items[i].args = pa_xstrdup(args);
m->items[i].index = PA_INVALID_INDEX; m->items[i].index = PA_INVALID_INDEX;
if (!(mod = pa_module_load(u->core, name, args))) { if (!(mod = pa_module_load(u->core, name, args))) {
pa_log("pa_module_load() failed"); pa_log("pa_module_load() failed");
return; return;
} }
m->items[i].index = mod->index; m->items[i].index = mod->index;
} }
@ -227,18 +227,18 @@ static int handle_event(struct userdata *u) {
do { do {
if ((opcode = read_byte(u)) < 0) if ((opcode = read_byte(u)) < 0)
goto fail; goto fail;
switch (opcode) { switch (opcode) {
case '!': case '!':
/* The helper tool is now initialized */ /* The helper tool is now initialized */
ret = 1; ret = 1;
break; break;
case '+': { case '+': {
char *name; char *name;
struct module_info *m; struct module_info *m;
unsigned i, j; unsigned i, j;
if (!(name = read_string(u))) if (!(name = read_string(u)))
goto fail; goto fail;
@ -282,16 +282,16 @@ static int handle_event(struct userdata *u) {
/* Unload all removed modules */ /* Unload all removed modules */
for (j = i; j < m->n_items; j++) for (j = i; j < m->n_items; j++)
unload_one_module(u, m, j); unload_one_module(u, m, j);
m->n_items = i; m->n_items = i;
break; break;
} }
case '-': { case '-': {
char *name; char *name;
struct module_info *m; struct module_info *m;
if (!(name = read_string(u))) if (!(name = read_string(u)))
goto fail; goto fail;
@ -301,7 +301,7 @@ static int handle_event(struct userdata *u) {
} }
pa_xfree(name); pa_xfree(name);
break; break;
} }
} }
@ -324,12 +324,12 @@ static void io_event_cb(
struct userdata *u = userdata; struct userdata *u = userdata;
if (handle_event(u) < 0) { if (handle_event(u) < 0) {
if (u->io_event) { if (u->io_event) {
u->core->mainloop->io_free(u->io_event); u->core->mainloop->io_free(u->io_event);
u->io_event = NULL; u->io_event = NULL;
} }
pa_module_unload_request(u->module); pa_module_unload_request(u->module);
} }
} }
@ -342,7 +342,7 @@ static int start_client(const char *n, pid_t *pid) {
pa_log("pipe() failed: %s", pa_cstrerror(errno)); pa_log("pipe() failed: %s", pa_cstrerror(errno));
goto fail; goto fail;
} }
if ((child = fork()) == (pid_t) -1) { if ((child = fork()) == (pid_t) -1) {
pa_log("fork() failed: %s", pa_cstrerror(errno)); pa_log("fork() failed: %s", pa_cstrerror(errno));
goto fail; goto fail;
@ -357,7 +357,7 @@ static int start_client(const char *n, pid_t *pid) {
return pipe_fds[0]; return pipe_fds[0];
} else { } else {
int max_fd, i; int max_fd, i;
/* child */ /* child */
close(pipe_fds[0]); close(pipe_fds[0]);
@ -373,7 +373,7 @@ static int start_client(const char *n, pid_t *pid) {
open("/dev/null", O_WRONLY); open("/dev/null", O_WRONLY);
max_fd = 1024; max_fd = 1024;
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
{ {
struct rlimit r; struct rlimit r;
@ -381,7 +381,7 @@ static int start_client(const char *n, pid_t *pid) {
max_fd = r.rlim_max; max_fd = r.rlim_max;
} }
#endif #endif
for (i = 3; i < max_fd; i++) for (i = 3; i < max_fd; i++)
close(i); close(i);
@ -402,14 +402,14 @@ static int start_client(const char *n, pid_t *pid) {
execl(n, n, NULL); execl(n, n, NULL);
_exit(1); _exit(1);
} }
fail: fail:
if (pipe_fds[0] >= 0) if (pipe_fds[0] >= 0)
close(pipe_fds[0]); close(pipe_fds[0]);
if (pipe_fds[1] >= 0) if (pipe_fds[1] >= 0)
close(pipe_fds[1]); close(pipe_fds[1]);
return -1; return -1;
} }
@ -427,17 +427,17 @@ int pa__init(pa_core *c, pa_module*m) {
u->fd_type = 0; u->fd_type = 0;
u->io_event = NULL; u->io_event = NULL;
u->buf_fill = 0; u->buf_fill = 0;
if ((u->fd = start_client(PA_GCONF_HELPER, &u->pid)) < 0) if ((u->fd = start_client(PA_GCONF_HELPER, &u->pid)) < 0)
goto fail; goto fail;
u->io_event = c->mainloop->io_new( u->io_event = c->mainloop->io_new(
c->mainloop, c->mainloop,
u->fd, u->fd,
PA_IO_EVENT_INPUT, PA_IO_EVENT_INPUT,
io_event_cb, io_event_cb,
u); u);
do { do {
if ((r = handle_event(u)) < 0) if ((r = handle_event(u)) < 0)
goto fail; goto fail;
@ -445,7 +445,7 @@ int pa__init(pa_core *c, pa_module*m) {
/* Read until the client signalled us that it is ready with /* Read until the client signalled us that it is ready with
* initialization */ * initialization */
} while (r != 1); } while (r != 1);
return 0; return 0;
fail: fail:

View file

@ -87,7 +87,7 @@ struct userdata {
pa_hashmap *devices; pa_hashmap *devices;
#if defined(HAVE_ALSA) && defined(HAVE_OSS) #if defined(HAVE_ALSA) && defined(HAVE_OSS)
int use_oss; int use_oss;
#endif #endif
}; };
struct timerdata { struct timerdata {
@ -269,7 +269,7 @@ static dbus_bool_t hal_device_add(struct userdata *u, const char *udi,
case CAP_OSS: case CAP_OSS:
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
if (u->use_oss) if (u->use_oss)
#endif #endif
m = hal_device_load_oss(u, udi, error); m = hal_device_load_oss(u, udi, error);
break; break;
#endif #endif
@ -533,9 +533,9 @@ int pa__init(pa_core *c, pa_module*m) {
#endif #endif
#if defined(HAVE_ALSA) && defined(HAVE_OSS) #if defined(HAVE_ALSA) && defined(HAVE_OSS)
u->use_oss = 0; u->use_oss = 0;
if (n <= 0) { if (n <= 0) {
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS
n += hal_device_add_all(u, CAP_OSS); n += hal_device_add_all(u, CAP_OSS);
#endif #endif
@ -546,7 +546,7 @@ int pa__init(pa_core *c, pa_module*m) {
if (n > 0) if (n > 0)
u->use_oss = 1; u->use_oss = 1;
} }
#endif #endif
libhal_ctx_set_user_data(hal_ctx, u); libhal_ctx_set_user_data(hal_ctx, u);
libhal_ctx_set_device_added(hal_ctx, device_added_cb); libhal_ctx_set_device_added(hal_ctx, device_added_cb);

View file

@ -172,11 +172,11 @@ static void do_write(struct userdata *u) {
if (errno != EAGAIN) { if (errno != EAGAIN) {
pa_log("write() failed: %s", pa_cstrerror(errno)); pa_log("write() failed: %s", pa_cstrerror(errno));
clear_up(u); clear_up(u);
pa_module_unload_request(u->module); pa_module_unload_request(u->module);
} }
break; break;
} }
@ -228,14 +228,14 @@ static void do_read(struct userdata *u) {
assert(memchunk.memblock); assert(memchunk.memblock);
if ((r = pa_iochannel_read(u->io, memchunk.memblock->data, memchunk.memblock->length)) < 0) { if ((r = pa_iochannel_read(u->io, memchunk.memblock->data, memchunk.memblock->length)) < 0) {
pa_memblock_unref(memchunk.memblock); pa_memblock_unref(memchunk.memblock);
if (errno != EAGAIN) { if (errno != EAGAIN) {
pa_log("read() failed: %s", pa_cstrerror(errno)); pa_log("read() failed: %s", pa_cstrerror(errno));
clear_up(u); clear_up(u);
pa_module_unload_request(u->module); pa_module_unload_request(u->module);
} }
break; break;
} }

View file

@ -3,17 +3,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@ -145,7 +145,7 @@ static void rtp_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
pa_memchunk chunk; pa_memchunk chunk;
int64_t k, j, delta; int64_t k, j, delta;
struct timeval tv; struct timeval tv;
assert(m); assert(m);
assert(e); assert(e);
assert(s); assert(s);
@ -159,7 +159,7 @@ static void rtp_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
pa_memblock_unref(chunk.memblock); pa_memblock_unref(chunk.memblock);
return; return;
} }
if (!s->first_packet) { if (!s->first_packet) {
s->first_packet = 1; s->first_packet = 1;
@ -183,7 +183,7 @@ static void rtp_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
delta = k; delta = k;
else else
delta = j; delta = j;
pa_memblockq_seek(s->memblockq, delta * s->rtp_context.frame_size, PA_SEEK_RELATIVE); pa_memblockq_seek(s->memblockq, delta * s->rtp_context.frame_size, PA_SEEK_RELATIVE);
if (pa_memblockq_push(s->memblockq, &chunk) < 0) { if (pa_memblockq_push(s->memblockq, &chunk) < 0) {
@ -191,10 +191,10 @@ static void rtp_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
pa_memblockq_flush(s->memblockq); pa_memblockq_flush(s->memblockq);
pa_memblockq_push(s->memblockq, &chunk); pa_memblockq_push(s->memblockq, &chunk);
} }
/* The next timestamp we expect */ /* The next timestamp we expect */
s->offset = s->rtp_context.timestamp + (chunk.length / s->rtp_context.frame_size); s->offset = s->rtp_context.timestamp + (chunk.length / s->rtp_context.frame_size);
pa_memblock_unref(chunk.memblock); pa_memblock_unref(chunk.memblock);
/* Reset death timer */ /* Reset death timer */
@ -205,7 +205,7 @@ static void rtp_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
static void death_event_cb(pa_mainloop_api *m, pa_time_event *t, const struct timeval *tv, void *userdata) { static void death_event_cb(pa_mainloop_api *m, pa_time_event *t, const struct timeval *tv, void *userdata) {
struct session *s = userdata; struct session *s = userdata;
assert(m); assert(m);
assert(t); assert(t);
assert(tv); assert(tv);
@ -216,7 +216,7 @@ static void death_event_cb(pa_mainloop_api *m, pa_time_event *t, const struct ti
static int mcast_socket(const struct sockaddr* sa, socklen_t salen) { static int mcast_socket(const struct sockaddr* sa, socklen_t salen) {
int af, fd = -1, r, one; int af, fd = -1, r, one;
af = sa->sa_family; af = sa->sa_family;
if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) { if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) {
pa_log("Failed to create socket: %s", pa_cstrerror(errno)); pa_log("Failed to create socket: %s", pa_cstrerror(errno));
@ -228,7 +228,7 @@ static int mcast_socket(const struct sockaddr* sa, socklen_t salen) {
pa_log("SO_REUSEADDR failed: %s", pa_cstrerror(errno)); pa_log("SO_REUSEADDR failed: %s", pa_cstrerror(errno));
goto fail; goto fail;
} }
if (af == AF_INET) { if (af == AF_INET) {
struct ip_mreq mr4; struct ip_mreq mr4;
memset(&mr4, 0, sizeof(mr4)); memset(&mr4, 0, sizeof(mr4));
@ -245,14 +245,14 @@ static int mcast_socket(const struct sockaddr* sa, socklen_t salen) {
pa_log_info("Joining mcast group failed: %s", pa_cstrerror(errno)); pa_log_info("Joining mcast group failed: %s", pa_cstrerror(errno));
goto fail; goto fail;
} }
if (bind(fd, sa, salen) < 0) { if (bind(fd, sa, salen) < 0) {
pa_log("bind() failed: %s", pa_cstrerror(errno)); pa_log("bind() failed: %s", pa_cstrerror(errno));
goto fail; goto fail;
} }
return fd; return fd;
fail: fail:
if (fd >= 0) if (fd >= 0)
close(fd); close(fd);
@ -273,7 +273,7 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
pa_log("session limit reached."); pa_log("session limit reached.");
goto fail; goto fail;
} }
if (!(sink = pa_namereg_get(u->core, u->sink_name, PA_NAMEREG_SINK, 1))) { if (!(sink = pa_namereg_get(u->core, u->sink_name, PA_NAMEREG_SINK, 1))) {
pa_log("sink does not exist."); pa_log("sink does not exist.");
goto fail; goto fail;
@ -289,7 +289,7 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
c = pa_sprintf_malloc("RTP Stream%s%s%s", c = pa_sprintf_malloc("RTP Stream%s%s%s",
sdp_info->session_name ? " (" : "", sdp_info->session_name ? " (" : "",
sdp_info->session_name ? sdp_info->session_name : "", sdp_info->session_name ? sdp_info->session_name : "",
sdp_info->session_name ? ")" : ""); sdp_info->session_name ? ")" : "");
pa_sink_input_new_data_init(&data); pa_sink_input_new_data_init(&data);
@ -298,10 +298,10 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
data.name = c; data.name = c;
data.module = u->module; data.module = u->module;
pa_sink_input_new_data_set_sample_spec(&data, &sdp_info->sample_spec); pa_sink_input_new_data_set_sample_spec(&data, &sdp_info->sample_spec);
s->sink_input = pa_sink_input_new(u->core, &data, 0); s->sink_input = pa_sink_input_new(u->core, &data, 0);
pa_xfree(c); pa_xfree(c);
if (!s->sink_input) { if (!s->sink_input) {
pa_log("failed to create sink input."); pa_log("failed to create sink input.");
goto fail; goto fail;
@ -318,7 +318,7 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
&s->sink_input->sample_spec, &s->sink_input->sample_spec,
(pa_bytes_per_second(&s->sink_input->sample_spec)/128/pa_frame_size(&s->sink_input->sample_spec))* (pa_bytes_per_second(&s->sink_input->sample_spec)/128/pa_frame_size(&s->sink_input->sample_spec))*
pa_frame_size(&s->sink_input->sample_spec)); pa_frame_size(&s->sink_input->sample_spec));
s->memblockq = pa_memblockq_new( s->memblockq = pa_memblockq_new(
0, 0,
MEMBLOCKQ_MAXLENGTH, MEMBLOCKQ_MAXLENGTH,
@ -331,7 +331,7 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
pa_memblock_unref(silence); pa_memblock_unref(silence);
s->rtp_event = u->core->mainloop->io_new(u->core->mainloop, fd, PA_IO_EVENT_INPUT, rtp_event_cb, s); s->rtp_event = u->core->mainloop->io_new(u->core->mainloop, fd, PA_IO_EVENT_INPUT, rtp_event_cb, s);
pa_gettimeofday(&tv); pa_gettimeofday(&tv);
pa_timeval_add(&tv, DEATH_TIMEOUT); pa_timeval_add(&tv, DEATH_TIMEOUT);
s->death_event = u->core->mainloop->time_new(u->core->mainloop, &tv, death_event_cb, s); s->death_event = u->core->mainloop->time_new(u->core->mainloop, &tv, death_event_cb, s);
@ -343,14 +343,14 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
pa_log_info("Found new session '%s'", s->sdp_info.session_name); pa_log_info("Found new session '%s'", s->sdp_info.session_name);
u->n_sessions++; u->n_sessions++;
return s; return s;
fail: fail:
if (s) { if (s) {
if (fd >= 0) if (fd >= 0)
close(fd); close(fd);
pa_xfree(s); pa_xfree(s);
} }
@ -377,7 +377,7 @@ static void session_free(struct session *s, int from_hash) {
assert(s->userdata->n_sessions >= 1); assert(s->userdata->n_sessions >= 1);
s->userdata->n_sessions--; s->userdata->n_sessions--;
pa_xfree(s); pa_xfree(s);
} }
@ -386,7 +386,7 @@ static void sap_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
int goodbye; int goodbye;
pa_sdp_info info; pa_sdp_info info;
struct session *s; struct session *s;
assert(m); assert(m);
assert(e); assert(e);
assert(u); assert(u);
@ -410,14 +410,14 @@ static void sap_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
if (!(s = pa_hashmap_get(u->by_origin, info.origin))) { if (!(s = pa_hashmap_get(u->by_origin, info.origin))) {
if (!(s = session_new(u, &info))) if (!(s = session_new(u, &info)))
pa_sdp_info_destroy(&info); pa_sdp_info_destroy(&info);
} else { } else {
struct timeval tv; struct timeval tv;
pa_gettimeofday(&tv); pa_gettimeofday(&tv);
pa_timeval_add(&tv, DEATH_TIMEOUT); pa_timeval_add(&tv, DEATH_TIMEOUT);
m->time_restart(s->death_event, &tv); m->time_restart(s->death_event, &tv);
pa_sdp_info_destroy(&info); pa_sdp_info_destroy(&info);
} }
} }
@ -432,7 +432,7 @@ int pa__init(pa_core *c, pa_module*m) {
socklen_t salen; socklen_t salen;
const char *sap_address; const char *sap_address;
int fd = -1; int fd = -1;
assert(c); assert(c);
assert(m); assert(m);
@ -442,7 +442,7 @@ int pa__init(pa_core *c, pa_module*m) {
} }
sap_address = pa_modargs_get_value(ma, "sap_address", DEFAULT_SAP_ADDRESS); sap_address = pa_modargs_get_value(ma, "sap_address", DEFAULT_SAP_ADDRESS);
if (inet_pton(AF_INET6, sap_address, &sa6.sin6_addr) > 0) { if (inet_pton(AF_INET6, sap_address, &sa6.sin6_addr) > 0) {
sa6.sin6_family = AF_INET6; sa6.sin6_family = AF_INET6;
sa6.sin6_port = htons(SAP_PORT); sa6.sin6_port = htons(SAP_PORT);
@ -471,9 +471,9 @@ int pa__init(pa_core *c, pa_module*m) {
u->sap_event = c->mainloop->io_new(c->mainloop, fd, PA_IO_EVENT_INPUT, sap_event_cb, u); u->sap_event = c->mainloop->io_new(c->mainloop, fd, PA_IO_EVENT_INPUT, sap_event_cb, u);
u->by_origin = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); u->by_origin = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
pa_sap_context_init_recv(&u->sap_context, fd); pa_sap_context_init_recv(&u->sap_context, fd);
pa_modargs_free(ma); pa_modargs_free(ma);
return 0; return 0;
@ -484,7 +484,7 @@ fail:
if (fd >= 0) if (fd >= 0)
close(fd); close(fd);
return -1; return -1;
} }
@ -504,7 +504,7 @@ void pa__done(pa_core *c, pa_module*m) {
pa_sap_context_destroy(&u->sap_context); pa_sap_context_destroy(&u->sap_context);
pa_hashmap_free(u->by_origin, free_func, NULL); pa_hashmap_free(u->by_origin, free_func, NULL);
pa_xfree(u->sink_name); pa_xfree(u->sink_name);
pa_xfree(u); pa_xfree(u);
} }

View file

@ -4,17 +4,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@ -111,7 +111,7 @@ static void source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
pa_log("Failed to push chunk into memblockq."); pa_log("Failed to push chunk into memblockq.");
return; return;
} }
pa_rtp_send(&u->rtp_context, u->mtu, u->memblockq); pa_rtp_send(&u->rtp_context, u->mtu, u->memblockq);
} }
@ -138,7 +138,7 @@ static pa_usec_t source_output_get_latency (pa_source_output *o) {
static void sap_event_cb(pa_mainloop_api *m, pa_time_event *t, const struct timeval *tv, void *userdata) { static void sap_event_cb(pa_mainloop_api *m, pa_time_event *t, const struct timeval *tv, void *userdata) {
struct userdata *u = userdata; struct userdata *u = userdata;
struct timeval next; struct timeval next;
assert(m); assert(m);
assert(t); assert(t);
assert(tv); assert(tv);
@ -172,7 +172,7 @@ int pa__init(pa_core *c, pa_module*m) {
char hn[128], *n; char hn[128], *n;
int loop = 0; int loop = 0;
pa_source_output_new_data data; pa_source_output_new_data data;
assert(c); assert(c);
assert(m); assert(m);
@ -210,7 +210,7 @@ int pa__init(pa_core *c, pa_module*m) {
payload = pa_rtp_payload_from_sample_spec(&ss); payload = pa_rtp_payload_from_sample_spec(&ss);
mtu = (DEFAULT_MTU/pa_frame_size(&ss))*pa_frame_size(&ss); mtu = (DEFAULT_MTU/pa_frame_size(&ss))*pa_frame_size(&ss);
if (pa_modargs_get_value_u32(ma, "mtu", &mtu) < 0 || mtu < 1 || mtu % pa_frame_size(&ss) != 0) { if (pa_modargs_get_value_u32(ma, "mtu", &mtu) < 0 || mtu < 1 || mtu % pa_frame_size(&ss) != 0) {
pa_log("invalid mtu."); pa_log("invalid mtu.");
goto fail; goto fail;
@ -241,7 +241,7 @@ int pa__init(pa_core *c, pa_module*m) {
pa_log("invalid destination '%s'", dest); pa_log("invalid destination '%s'", dest);
goto fail; goto fail;
} }
if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) { if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) {
pa_log("socket() failed: %s", pa_cstrerror(errno)); pa_log("socket() failed: %s", pa_cstrerror(errno));
goto fail; goto fail;
@ -275,7 +275,7 @@ int pa__init(pa_core *c, pa_module*m) {
data.source = s; data.source = s;
pa_source_output_new_data_set_sample_spec(&data, &ss); pa_source_output_new_data_set_sample_spec(&data, &ss);
pa_source_output_new_data_set_channel_map(&data, &cm); pa_source_output_new_data_set_channel_map(&data, &cm);
if (!(o = pa_source_output_new(c, &data, 0))) { if (!(o = pa_source_output_new(c, &data, 0))) {
pa_log("failed to create source output."); pa_log("failed to create source output.");
goto fail; goto fail;
@ -284,7 +284,7 @@ int pa__init(pa_core *c, pa_module*m) {
o->push = source_output_push; o->push = source_output_push;
o->kill = source_output_kill; o->kill = source_output_kill;
o->get_latency = source_output_get_latency; o->get_latency = source_output_get_latency;
u = pa_xnew(struct userdata, 1); u = pa_xnew(struct userdata, 1);
m->userdata = u; m->userdata = u;
o->userdata = u; o->userdata = u;
@ -292,7 +292,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->module = m; u->module = m;
u->core = c; u->core = c;
u->source_output = o; u->source_output = o;
u->memblockq = pa_memblockq_new( u->memblockq = pa_memblockq_new(
0, 0,
MEMBLOCKQ_MAXLENGTH, MEMBLOCKQ_MAXLENGTH,
@ -303,20 +303,20 @@ int pa__init(pa_core *c, pa_module*m) {
NULL); NULL);
u->mtu = mtu; u->mtu = mtu;
k = sizeof(sa_dst); k = sizeof(sa_dst);
r = getsockname(fd, (struct sockaddr*) &sa_dst, &k); r = getsockname(fd, (struct sockaddr*) &sa_dst, &k);
assert(r >= 0); assert(r >= 0);
n = pa_sprintf_malloc("PulseAudio RTP Stream on %s", pa_get_fqdn(hn, sizeof(hn))); n = pa_sprintf_malloc("PulseAudio RTP Stream on %s", pa_get_fqdn(hn, sizeof(hn)));
p = pa_sdp_build(af, p = pa_sdp_build(af,
af == AF_INET ? (void*) &((struct sockaddr_in*) &sa_dst)->sin_addr : (void*) &((struct sockaddr_in6*) &sa_dst)->sin6_addr, af == AF_INET ? (void*) &((struct sockaddr_in*) &sa_dst)->sin_addr : (void*) &((struct sockaddr_in6*) &sa_dst)->sin6_addr,
af == AF_INET ? (void*) &sa4.sin_addr : (void*) &sa6.sin6_addr, af == AF_INET ? (void*) &sa4.sin_addr : (void*) &sa6.sin6_addr,
n, port, payload, &ss); n, port, payload, &ss);
pa_xfree(n); pa_xfree(n);
pa_rtp_context_init_send(&u->rtp_context, fd, c->cookie, payload, pa_frame_size(&ss)); pa_rtp_context_init_send(&u->rtp_context, fd, c->cookie, payload, pa_frame_size(&ss));
pa_sap_context_init_send(&u->sap_context, sap_fd, p); pa_sap_context_init_send(&u->sap_context, sap_fd, p);
@ -339,7 +339,7 @@ fail:
if (fd >= 0) if (fd >= 0)
close(fd); close(fd);
if (sap_fd >= 0) if (sap_fd >= 0)
close(sap_fd); close(sap_fd);
@ -347,7 +347,7 @@ fail:
pa_source_output_disconnect(o); pa_source_output_disconnect(o);
pa_source_output_unref(o); pa_source_output_unref(o);
} }
return -1; return -1;
} }
@ -360,7 +360,7 @@ void pa__done(pa_core *c, pa_module*m) {
return; return;
c->mainloop->time_free(u->sap_event); c->mainloop->time_free(u->sap_event);
if (u->source_output) { if (u->source_output) {
pa_source_output_disconnect(u->source_output); pa_source_output_disconnect(u->source_output);
pa_source_output_unref(u->source_output); pa_source_output_unref(u->source_output);
@ -372,6 +372,6 @@ void pa__done(pa_core *c, pa_module*m) {
pa_sap_context_destroy(&u->sap_context); pa_sap_context_destroy(&u->sap_context);
pa_memblockq_free(u->memblockq); pa_memblockq_free(u->memblockq);
pa_xfree(u); pa_xfree(u);
} }

View file

@ -4,17 +4,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@ -53,7 +53,7 @@ pa_rtp_context* pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssr
c->ssrc = ssrc ? ssrc : (uint32_t) (rand()*rand()); c->ssrc = ssrc ? ssrc : (uint32_t) (rand()*rand());
c->payload = payload & 127; c->payload = payload & 127;
c->frame_size = frame_size; c->frame_size = frame_size;
return c; return c;
} }
@ -64,14 +64,14 @@ int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q) {
pa_memblock* mb[MAX_IOVECS]; pa_memblock* mb[MAX_IOVECS];
int iov_idx = 1; int iov_idx = 1;
size_t n = 0, skip = 0; size_t n = 0, skip = 0;
assert(c); assert(c);
assert(size > 0); assert(size > 0);
assert(q); assert(q);
if (pa_memblockq_get_length(q) < size) if (pa_memblockq_get_length(q) < size)
return 0; return 0;
for (;;) { for (;;) {
int r; int r;
pa_memchunk chunk; pa_memchunk chunk;
@ -105,7 +105,7 @@ int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q) {
iov[0].iov_base = (void*)header; iov[0].iov_base = (void*)header;
iov[0].iov_len = sizeof(header); iov[0].iov_len = sizeof(header);
m.msg_name = NULL; m.msg_name = NULL;
m.msg_namelen = 0; m.msg_namelen = 0;
m.msg_iov = iov; m.msg_iov = iov;
@ -113,7 +113,7 @@ int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q) {
m.msg_control = NULL; m.msg_control = NULL;
m.msg_controllen = 0; m.msg_controllen = 0;
m.msg_flags = 0; m.msg_flags = 0;
k = sendmsg(c->fd, &m, MSG_DONTWAIT); k = sendmsg(c->fd, &m, MSG_DONTWAIT);
for (i = 1; i < iov_idx; i++) for (i = 1; i < iov_idx; i++)
@ -124,13 +124,13 @@ int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q) {
k = 0; k = 0;
c->timestamp += skip/c->frame_size; c->timestamp += skip/c->frame_size;
if (k < 0) { if (k < 0) {
if (errno != EAGAIN) /* If the queue is full, just ignore it */ if (errno != EAGAIN) /* If the queue is full, just ignore it */
pa_log("sendmsg() failed: %s", pa_cstrerror(errno)); pa_log("sendmsg() failed: %s", pa_cstrerror(errno));
return -1; return -1;
} }
if (r < 0 || pa_memblockq_get_length(q) < size) if (r < 0 || pa_memblockq_get_length(q) < size)
break; break;
@ -158,7 +158,7 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool) {
uint32_t header; uint32_t header;
int cc; int cc;
ssize_t r; ssize_t r;
assert(c); assert(c);
assert(chunk); assert(chunk);
@ -184,7 +184,7 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool) {
m.msg_control = NULL; m.msg_control = NULL;
m.msg_controllen = 0; m.msg_controllen = 0;
m.msg_flags = 0; m.msg_flags = 0;
if ((r = recvmsg(c->fd, &m, 0)) != size) { if ((r = recvmsg(c->fd, &m, 0)) != size) {
pa_log("recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch"); pa_log("recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch");
goto fail; goto fail;
@ -198,7 +198,7 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool) {
memcpy(&header, chunk->memblock->data, sizeof(uint32_t)); memcpy(&header, chunk->memblock->data, sizeof(uint32_t));
memcpy(&c->timestamp, (uint8_t*) chunk->memblock->data + 4, sizeof(uint32_t)); memcpy(&c->timestamp, (uint8_t*) chunk->memblock->data + 4, sizeof(uint32_t));
memcpy(&c->ssrc, (uint8_t*) chunk->memblock->data + 8, sizeof(uint32_t)); memcpy(&c->ssrc, (uint8_t*) chunk->memblock->data + 8, sizeof(uint32_t));
header = ntohl(header); header = ntohl(header);
c->timestamp = ntohl(c->timestamp); c->timestamp = ntohl(c->timestamp);
c->ssrc = ntohl(c->ssrc); c->ssrc = ntohl(c->ssrc);
@ -234,7 +234,7 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool) {
pa_log("Vad RTP packet size."); pa_log("Vad RTP packet size.");
goto fail; goto fail;
} }
return 0; return 0;
fail: fail:
@ -255,7 +255,7 @@ uint8_t pa_rtp_payload_from_sample_spec(const pa_sample_spec *ss) {
return 10; return 10;
if (ss->format == PA_SAMPLE_S16BE && ss->rate == 44100 && ss->channels == 1) if (ss->format == PA_SAMPLE_S16BE && ss->rate == 44100 && ss->channels == 1)
return 11; return 11;
return 127; return 127;
} }
@ -280,7 +280,7 @@ pa_sample_spec *pa_rtp_sample_spec_from_payload(uint8_t payload, pa_sample_spec
ss->format = PA_SAMPLE_S16BE; ss->format = PA_SAMPLE_S16BE;
ss->rate = 44100; ss->rate = 44100;
break; break;
case 11: case 11:
ss->channels = 1; ss->channels = 1;
ss->format = PA_SAMPLE_S16BE; ss->format = PA_SAMPLE_S16BE;
@ -340,7 +340,7 @@ const char* pa_rtp_format_to_string(pa_sample_format_t f) {
pa_sample_format_t pa_rtp_string_to_format(const char *s) { pa_sample_format_t pa_rtp_string_to_format(const char *s) {
assert(s); assert(s);
if (!(strcmp(s, "L16"))) if (!(strcmp(s, "L16")))
return PA_SAMPLE_S16BE; return PA_SAMPLE_S16BE;
else if (!strcmp(s, "L8")) else if (!strcmp(s, "L8"))

View file

@ -7,17 +7,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307

View file

@ -4,17 +4,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@ -60,8 +60,8 @@ pa_sap_context* pa_sap_context_init_send(pa_sap_context *c, int fd, char *sdp_da
c->fd = fd; c->fd = fd;
c->sdp_data = sdp_data; c->sdp_data = sdp_data;
c->msg_id_hash = (uint16_t) (rand()*rand()); c->msg_id_hash = (uint16_t) (rand()*rand());
return c; return c;
} }
void pa_sap_context_destroy(pa_sap_context *c) { void pa_sap_context_destroy(pa_sap_context *c) {
@ -86,7 +86,7 @@ int pa_sap_send(pa_sap_context *c, int goodbye) {
} }
assert(sa->sa_family == AF_INET || sa->sa_family == AF_INET6); assert(sa->sa_family == AF_INET || sa->sa_family == AF_INET6);
header = htonl(((uint32_t) 1 << 29) | header = htonl(((uint32_t) 1 << 29) |
(sa->sa_family == AF_INET6 ? (uint32_t) 1 << 28 : 0) | (sa->sa_family == AF_INET6 ? (uint32_t) 1 << 28 : 0) |
(goodbye ? (uint32_t) 1 << 26 : 0) | (goodbye ? (uint32_t) 1 << 26 : 0) |
@ -103,7 +103,7 @@ int pa_sap_send(pa_sap_context *c, int goodbye) {
iov[3].iov_base = c->sdp_data; iov[3].iov_base = c->sdp_data;
iov[3].iov_len = strlen(c->sdp_data); iov[3].iov_len = strlen(c->sdp_data);
m.msg_name = NULL; m.msg_name = NULL;
m.msg_namelen = 0; m.msg_namelen = 0;
m.msg_iov = iov; m.msg_iov = iov;
@ -111,7 +111,7 @@ int pa_sap_send(pa_sap_context *c, int goodbye) {
m.msg_control = NULL; m.msg_control = NULL;
m.msg_controllen = 0; m.msg_controllen = 0;
m.msg_flags = 0; m.msg_flags = 0;
if ((k = sendmsg(c->fd, &m, MSG_DONTWAIT)) < 0) if ((k = sendmsg(c->fd, &m, MSG_DONTWAIT)) < 0)
pa_log("sendmsg() failed: %s\n", pa_cstrerror(errno)); pa_log("sendmsg() failed: %s\n", pa_cstrerror(errno));
@ -135,7 +135,7 @@ int pa_sap_recv(pa_sap_context *c, int *goodbye) {
uint32_t header; uint32_t header;
int six, ac; int six, ac;
ssize_t r; ssize_t r;
assert(c); assert(c);
assert(goodbye); assert(goodbye);
@ -146,7 +146,7 @@ int pa_sap_recv(pa_sap_context *c, int *goodbye) {
buf = pa_xnew(char, size+1); buf = pa_xnew(char, size+1);
buf[size] = 0; buf[size] = 0;
iov.iov_base = buf; iov.iov_base = buf;
iov.iov_len = size; iov.iov_len = size;
@ -157,7 +157,7 @@ int pa_sap_recv(pa_sap_context *c, int *goodbye) {
m.msg_control = NULL; m.msg_control = NULL;
m.msg_controllen = 0; m.msg_controllen = 0;
m.msg_flags = 0; m.msg_flags = 0;
if ((r = recvmsg(c->fd, &m, 0)) != size) { if ((r = recvmsg(c->fd, &m, 0)) != size) {
pa_log("recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch"); pa_log("recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch");
goto fail; goto fail;
@ -208,12 +208,12 @@ int pa_sap_recv(pa_sap_context *c, int *goodbye) {
if (c->sdp_data) if (c->sdp_data)
pa_xfree(c->sdp_data); pa_xfree(c->sdp_data);
c->sdp_data = pa_xstrndup(e, size); c->sdp_data = pa_xstrndup(e, size);
pa_xfree(buf); pa_xfree(buf);
*goodbye = !!((header >> 26) & 1); *goodbye = !!((header >> 26) & 1);
return 0; return 0;
fail: fail:

View file

@ -7,17 +7,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307

View file

@ -4,17 +4,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@ -54,18 +54,18 @@ char *pa_sdp_build(int af, const void *src, const void *dst, const char *name, u
f = pa_rtp_format_to_string(ss->format); f = pa_rtp_format_to_string(ss->format);
assert(f); assert(f);
if (!(u = getenv("USER"))) if (!(u = getenv("USER")))
if (!(u = getenv("USERNAME"))) if (!(u = getenv("USERNAME")))
u = "-"; u = "-";
ntp = time(NULL) + 2208988800U; ntp = time(NULL) + 2208988800U;
a = inet_ntop(af, src, buf_src, sizeof(buf_src)); a = inet_ntop(af, src, buf_src, sizeof(buf_src));
assert(a); assert(a);
a = inet_ntop(af, dst, buf_dst, sizeof(buf_dst)); a = inet_ntop(af, dst, buf_dst, sizeof(buf_dst));
assert(a); assert(a);
return pa_sprintf_malloc( return pa_sprintf_malloc(
PA_SDP_HEADER PA_SDP_HEADER
"o=%s %lu 0 IN %s %s\n" "o=%s %lu 0 IN %s %s\n"
@ -125,11 +125,11 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
assert(t); assert(t);
assert(i); assert(i);
i->origin = i->session_name = NULL; i->origin = i->session_name = NULL;
i->salen = 0; i->salen = 0;
i->payload = 255; i->payload = 255;
if (!pa_startswith(t, PA_SDP_HEADER)) { if (!pa_startswith(t, PA_SDP_HEADER)) {
pa_log("Failed to parse SDP data: invalid header."); pa_log("Failed to parse SDP data: invalid header.");
goto fail; goto fail;
@ -156,7 +156,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
size_t k; size_t k;
k = l-8 > sizeof(a) ? sizeof(a) : l-8; k = l-8 > sizeof(a) ? sizeof(a) : l-8;
pa_strlcpy(a, t+9, k); pa_strlcpy(a, t+9, k);
a[strcspn(a, "/")] = 0; a[strcspn(a, "/")] = 0;
@ -173,7 +173,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
size_t k; size_t k;
k = l-8 > sizeof(a) ? sizeof(a) : l-8; k = l-8 > sizeof(a) ? sizeof(a) : l-8;
pa_strlcpy(a, t+9, k); pa_strlcpy(a, t+9, k);
a[strcspn(a, "/")] = 0; a[strcspn(a, "/")] = 0;
@ -189,7 +189,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
if (i->payload > 127) { if (i->payload > 127) {
int _port, _payload; int _port, _payload;
if (sscanf(t+8, "%i RTP/AVP %i", &_port, &_payload) == 2) { if (sscanf(t+8, "%i RTP/AVP %i", &_port, &_payload) == 2) {
if (_port <= 0 || _port > 0xFFFF) { if (_port <= 0 || _port > 0xFFFF) {
@ -224,16 +224,16 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
if (_payload == i->payload) { if (_payload == i->payload) {
c[strcspn(c, "\n")] = 0; c[strcspn(c, "\n")] = 0;
if (parse_sdp_sample_spec(&i->sample_spec, c)) if (parse_sdp_sample_spec(&i->sample_spec, c))
ss_valid = 1; ss_valid = 1;
} }
} }
} }
} }
t += l; t += l;
if (*t == '\n') if (*t == '\n')
t++; t++;
} }
@ -247,7 +247,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
((struct sockaddr_in*) &i->sa)->sin_port = htons(port); ((struct sockaddr_in*) &i->sa)->sin_port = htons(port);
else else
((struct sockaddr_in6*) &i->sa)->sin6_port = htons(port); ((struct sockaddr_in6*) &i->sa)->sin6_port = htons(port);
return i; return i;
fail: fail:

View file

@ -7,17 +7,17 @@
This file is part of PulseAudio. This file is part of PulseAudio.
Copyright 2006 Lennart Poettering Copyright 2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser 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, by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307

View file

@ -1033,10 +1033,10 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
if (ifstate && *ifstate == IFSTATE_FALSE) if (ifstate && *ifstate == IFSTATE_FALSE)
return 0; return 0;
l = strcspn(cs, whitespace); l = strcspn(cs, whitespace);
for (command = commands; command->name; command++) for (command = commands; command->name; command++)
if (strlen(command->name) == l && !strncmp(cs, command->name, l)) { if (strlen(command->name) == l && !strncmp(cs, command->name, l)) {
int ret; int ret;
@ -1071,7 +1071,7 @@ int pa_cli_command_execute_file(pa_core *c, const char *fn, pa_strbuf *buf, int
FILE *f = NULL; FILE *f = NULL;
int ifstate = IFSTATE_NONE; int ifstate = IFSTATE_NONE;
int ret = -1; int ret = -1;
assert(c); assert(c);
assert(fn); assert(fn);
assert(buf); assert(buf);
@ -1103,7 +1103,7 @@ fail:
int pa_cli_command_execute(pa_core *c, const char *s, pa_strbuf *buf, int *fail) { int pa_cli_command_execute(pa_core *c, const char *s, pa_strbuf *buf, int *fail) {
const char *p; const char *p;
int ifstate = IFSTATE_NONE; int ifstate = IFSTATE_NONE;
assert(c); assert(c);
assert(s); assert(s);
assert(buf); assert(buf);

View file

@ -492,7 +492,7 @@ void pa_raise_priority(void) {
if ((caps = cap_get_proc())) { if ((caps = cap_get_proc())) {
cap_t caps_new; cap_t caps_new;
cap_value_t nice_cap = CAP_SYS_NICE; cap_value_t nice_cap = CAP_SYS_NICE;
if ((caps_new = cap_dup(caps))) { if ((caps_new = cap_dup(caps))) {
cap_set_flag(caps_new, CAP_EFFECTIVE, 1, &nice_cap, CAP_SET); cap_set_flag(caps_new, CAP_EFFECTIVE, 1, &nice_cap, CAP_SET);
cap_set_flag(caps_new, CAP_PERMITTED, 1, &nice_cap, CAP_SET); cap_set_flag(caps_new, CAP_PERMITTED, 1, &nice_cap, CAP_SET);
@ -501,7 +501,7 @@ void pa_raise_priority(void) {
} }
} }
#endif #endif
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
if (setpriority(PRIO_PROCESS, 0, NICE_LEVEL) < 0) if (setpriority(PRIO_PROCESS, 0, NICE_LEVEL) < 0)
pa_log_warn("setpriority(): %s", pa_cstrerror(errno)); pa_log_warn("setpriority(): %s", pa_cstrerror(errno));

File diff suppressed because it is too large Load diff

View file

@ -764,7 +764,7 @@ static void command_create_playback_stream(PA_GCC_UNUSED pa_pdispatch *pd, PA_GC
CHECK_VALIDITY(c->pstream, map.channels == ss.channels && volume.channels == ss.channels, tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, map.channels == ss.channels && volume.channels == ss.channels, tag, PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, maxlength > 0 && maxlength <= MAX_MEMBLOCKQ_LENGTH, tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, maxlength > 0 && maxlength <= MAX_MEMBLOCKQ_LENGTH, tag, PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, maxlength >= pa_frame_size(&ss), tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, maxlength >= pa_frame_size(&ss), tag, PA_ERR_INVALID);
if (sink_index != PA_INVALID_INDEX) { if (sink_index != PA_INVALID_INDEX) {
sink = pa_idxset_get_by_index(c->protocol->core->sinks, sink_index); sink = pa_idxset_get_by_index(c->protocol->core->sinks, sink_index);
CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY); CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY);

View file

@ -56,7 +56,7 @@ pa_memblock *pa_silence_memblock_new(pa_mempool *pool, const pa_sample_spec *spe
if (length <= 0) if (length <= 0)
length = fs; length = fs;
return pa_silence_memblock(pa_memblock_new(pool, length), spec); return pa_silence_memblock(pa_memblock_new(pool, length), spec);
} }

View file

@ -111,7 +111,7 @@ pa_thread* pa_thread_new(pa_thread_func_t thread_func, void *userdata) {
int pa_thread_is_running(pa_thread *t) { int pa_thread_is_running(pa_thread *t) {
assert(t); assert(t);
/* Unfortunately there is no way to tell whether a "foreign" /* Unfortunately there is no way to tell whether a "foreign"
* thread is still running. See * thread is still running. See
* http://udrepper.livejournal.com/16844.html for more * http://udrepper.livejournal.com/16844.html for more

View file

@ -2230,7 +2230,7 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_SETDUPLEX\n"); debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_SETDUPLEX\n");
/* this is a no-op */ /* this is a no-op */
break; break;
default: default:
debug(DEBUG_LEVEL_NORMAL, __FILE__": unknown ioctl 0x%08lx\n", request); debug(DEBUG_LEVEL_NORMAL, __FILE__": unknown ioctl 0x%08lx\n", request);