mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
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:
parent
e4d63d0d80
commit
1e12e0ee8d
21 changed files with 2721 additions and 2721 deletions
|
|
@ -126,7 +126,7 @@ pulseaudio_SOURCES = \
|
|||
pulsecore/gccmacro.h
|
||||
|
||||
pulseaudio_CFLAGS = $(AM_CFLAGS) $(LIBOIL_CFLAGS)
|
||||
pulseaudio_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
pulseaudio_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
pulseaudio_LDADD = $(AM_LDADD) libpulsecore.la $(LIBLTDL) \
|
||||
$(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS) $(CAP_LIBS) $(LIBOIL_LIBS)
|
||||
# This is needed because automake doesn't properly expand the foreach below
|
||||
|
|
@ -168,8 +168,8 @@ endif
|
|||
bin_SCRIPTS = esdcompat
|
||||
|
||||
pacat_SOURCES = utils/pacat.c
|
||||
pacat_LDADD = $(AM_LDADD) libpulse.la
|
||||
pacat_CFLAGS = $(AM_CFLAGS)
|
||||
pacat_LDADD = $(AM_LDADD) libpulse.la
|
||||
pacat_CFLAGS = $(AM_CFLAGS)
|
||||
pacat_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
|
||||
|
||||
paplay_SOURCES = utils/paplay.c
|
||||
|
|
@ -247,7 +247,7 @@ utf8_test_CFLAGS = $(AM_CFLAGS)
|
|||
utf8_test_LDADD = $(AM_LDADD) libpulsecore.la
|
||||
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_LDADD = $(AM_LDADD) libpulse.la
|
||||
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_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_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_CFLAGS = $(AM_CFLAGS)
|
||||
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 \
|
||||
pulsecore/atomic.h \
|
||||
pulsecore/flist.c pulsecore/flist.h
|
||||
flist_test_CFLAGS = $(AM_CFLAGS)
|
||||
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_CFLAGS = $(AM_CFLAGS)
|
||||
|
|
@ -333,12 +333,12 @@ memblockq_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
|
|||
|
||||
sync_playback_SOURCES = tests/sync-playback.c
|
||||
sync_playback_LDADD = $(AM_LDADD) libpulse.la
|
||||
sync_playback_CFLAGS = $(AM_CFLAGS)
|
||||
sync_playback_CFLAGS = $(AM_CFLAGS)
|
||||
sync_playback_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
|
||||
|
||||
interpol_test_SOURCES = tests/interpol-test.c
|
||||
interpol_test_LDADD = $(AM_LDADD) libpulse.la
|
||||
interpol_test_CFLAGS = $(AM_CFLAGS)
|
||||
interpol_test_CFLAGS = $(AM_CFLAGS)
|
||||
interpol_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
|
||||
|
||||
###################################
|
||||
|
|
@ -459,7 +459,7 @@ libpulse_la_SOURCES += \
|
|||
|
||||
if OS_IS_WIN32
|
||||
libpulse_la_SOURCES += \
|
||||
pulsecore/dllmain.c
|
||||
pulsecore/dllmain.c
|
||||
endif
|
||||
|
||||
if HAVE_X11
|
||||
|
|
@ -482,7 +482,7 @@ libpulse_la_CFLAGS += $(LIBASYNCNS_CFLAGS)
|
|||
libpulse_la_LIBADD += $(LIBASYNCNS_LIBS)
|
||||
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_LIBADD = $(AM_LIBADD) libpulse.la
|
||||
libpulse_simple_la_LDFLAGS = -version-info $(LIBPULSE_SIMPLE_VERSION_INFO)
|
||||
|
|
@ -640,7 +640,7 @@ libpulsecore_la_SOURCES += \
|
|||
|
||||
if OS_IS_WIN32
|
||||
libpulsecore_la_SOURCES += \
|
||||
pulsecore/dllmain.c
|
||||
pulsecore/dllmain.c
|
||||
endif
|
||||
|
||||
libpulsecore_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBOIL_CFLAGS)
|
||||
|
|
@ -820,7 +820,7 @@ libsocket_util_la_SOURCES = \
|
|||
libsocket_util_la_LDFLAGS = -avoid-version
|
||||
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_LIBADD = $(AM_LIBADD) libpulsecore.la
|
||||
|
||||
|
|
@ -1298,7 +1298,7 @@ esdcompat: daemon/esdcompat.in Makefile
|
|||
client.conf: pulse/client.conf.in Makefile
|
||||
sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' < $< > $@
|
||||
|
||||
if OS_IS_WIN32
|
||||
if OS_IS_WIN32
|
||||
default.pa: daemon/default.pa.win32
|
||||
cp $< $@
|
||||
else
|
||||
|
|
|
|||
|
|
@ -97,9 +97,9 @@ int pa_limit_caps(void) {
|
|||
|
||||
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0)
|
||||
goto fail;
|
||||
|
||||
|
||||
pa_log_info("dropped capabilities successfully.");
|
||||
|
||||
|
||||
r = 1;
|
||||
|
||||
fail:
|
||||
|
|
@ -119,12 +119,12 @@ int pa_drop_caps(void) {
|
|||
cap_clear(caps);
|
||||
|
||||
prctl(PR_SET_KEEPCAPS, 0, 0, 0, 0);
|
||||
|
||||
|
||||
if (cap_set_proc(caps) < 0) {
|
||||
pa_log("failed to drop capabilities: %s", pa_cstrerror(errno));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
r = 0;
|
||||
|
||||
fail:
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
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);
|
||||
enabled = gconf_client_get_bool(client, p, FALSE);
|
||||
|
||||
|
||||
printf("%c%s%c", enabled ? '+' : '-', name, 0);
|
||||
|
||||
if (enabled) {
|
||||
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
gchar *n, *a;
|
||||
|
||||
|
||||
snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/name%i", name, i);
|
||||
if (!(n = gconf_client_get_string(client, p, NULL)) || !*n)
|
||||
break;
|
||||
|
||||
|
||||
snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/args%i", name, i);
|
||||
a = gconf_client_get_string(client, p, NULL);
|
||||
|
||||
|
||||
printf("%s%c%s%c", n, 0, a ? a : "", 0);
|
||||
|
||||
|
||||
g_free(n);
|
||||
g_free(a);
|
||||
}
|
||||
|
||||
|
||||
printf("%c", 0);
|
||||
}
|
||||
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ static void modules_callback(
|
|||
|
||||
const char *n;
|
||||
char buf[128];
|
||||
|
||||
|
||||
g_assert(strncmp(entry->key, PA_GCONF_PATH_MODULES"/", sizeof(PA_GCONF_PATH_MODULES)) == 0);
|
||||
|
||||
n = entry->key + sizeof(PA_GCONF_PATH_MODULES);
|
||||
|
|
@ -113,17 +113,17 @@ int main(int argc, char *argv[]) {
|
|||
char *e = strrchr(m->data, '/');
|
||||
handle_module(client, e ? e+1 : m->data);
|
||||
}
|
||||
|
||||
|
||||
g_slist_free(modules);
|
||||
|
||||
/* Signal the parent that we are now initialized */
|
||||
printf("!");
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
g = g_main_loop_new(NULL, FALSE);
|
||||
g_main_loop_run(g);
|
||||
g_main_loop_unref(g);
|
||||
|
||||
|
||||
g_object_unref(G_OBJECT(client));
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
|
@ -80,7 +80,7 @@ struct module_info {
|
|||
struct userdata {
|
||||
pa_core *core;
|
||||
pa_module *module;
|
||||
|
||||
|
||||
pa_hashmap *module_infos;
|
||||
|
||||
pid_t pid;
|
||||
|
|
@ -129,7 +129,7 @@ static char *read_string(struct userdata *u) {
|
|||
|
||||
for (;;) {
|
||||
char *e;
|
||||
|
||||
|
||||
if ((e = memchr(u->buf, 0, u->buf_fill))) {
|
||||
char *ret = pa_xstrdup(u->buf);
|
||||
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)
|
||||
return;
|
||||
|
||||
|
||||
pa_log_debug("Unloading module #%i", m->items[i].index);
|
||||
pa_module_unload_by_index(u->core, m->items[i].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) {
|
||||
unsigned i;
|
||||
|
||||
|
||||
assert(u);
|
||||
assert(m);
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ static void load_module(
|
|||
int is_new) {
|
||||
|
||||
pa_module *mod;
|
||||
|
||||
|
||||
assert(u);
|
||||
assert(m);
|
||||
assert(name);
|
||||
|
|
@ -193,18 +193,18 @@ static void load_module(
|
|||
|
||||
unload_one_module(u, m, i);
|
||||
}
|
||||
|
||||
|
||||
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].args = pa_xstrdup(args);
|
||||
m->items[i].index = PA_INVALID_INDEX;
|
||||
|
||||
|
||||
if (!(mod = pa_module_load(u->core, name, args))) {
|
||||
pa_log("pa_module_load() failed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m->items[i].index = mod->index;
|
||||
}
|
||||
|
||||
|
|
@ -227,18 +227,18 @@ static int handle_event(struct userdata *u) {
|
|||
do {
|
||||
if ((opcode = read_byte(u)) < 0)
|
||||
goto fail;
|
||||
|
||||
|
||||
switch (opcode) {
|
||||
case '!':
|
||||
/* The helper tool is now initialized */
|
||||
ret = 1;
|
||||
break;
|
||||
|
||||
|
||||
case '+': {
|
||||
char *name;
|
||||
struct module_info *m;
|
||||
unsigned i, j;
|
||||
|
||||
|
||||
if (!(name = read_string(u)))
|
||||
goto fail;
|
||||
|
||||
|
|
@ -282,16 +282,16 @@ static int handle_event(struct userdata *u) {
|
|||
/* Unload all removed modules */
|
||||
for (j = i; j < m->n_items; j++)
|
||||
unload_one_module(u, m, j);
|
||||
|
||||
|
||||
m->n_items = i;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case '-': {
|
||||
char *name;
|
||||
struct module_info *m;
|
||||
|
||||
|
||||
if (!(name = read_string(u)))
|
||||
goto fail;
|
||||
|
||||
|
|
@ -301,7 +301,7 @@ static int handle_event(struct userdata *u) {
|
|||
}
|
||||
|
||||
pa_xfree(name);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -324,12 +324,12 @@ static void io_event_cb(
|
|||
struct userdata *u = userdata;
|
||||
|
||||
if (handle_event(u) < 0) {
|
||||
|
||||
|
||||
if (u->io_event) {
|
||||
u->core->mainloop->io_free(u->io_event);
|
||||
u->io_event = NULL;
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
if ((child = fork()) == (pid_t) -1) {
|
||||
pa_log("fork() failed: %s", pa_cstrerror(errno));
|
||||
goto fail;
|
||||
|
|
@ -357,7 +357,7 @@ static int start_client(const char *n, pid_t *pid) {
|
|||
return pipe_fds[0];
|
||||
} else {
|
||||
int max_fd, i;
|
||||
|
||||
|
||||
/* child */
|
||||
|
||||
close(pipe_fds[0]);
|
||||
|
|
@ -373,7 +373,7 @@ static int start_client(const char *n, pid_t *pid) {
|
|||
open("/dev/null", O_WRONLY);
|
||||
|
||||
max_fd = 1024;
|
||||
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
{
|
||||
struct rlimit r;
|
||||
|
|
@ -381,7 +381,7 @@ static int start_client(const char *n, pid_t *pid) {
|
|||
max_fd = r.rlim_max;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
for (i = 3; i < max_fd; i++)
|
||||
close(i);
|
||||
|
||||
|
|
@ -402,14 +402,14 @@ static int start_client(const char *n, pid_t *pid) {
|
|||
execl(n, n, NULL);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
|
||||
fail:
|
||||
if (pipe_fds[0] >= 0)
|
||||
close(pipe_fds[0]);
|
||||
|
||||
if (pipe_fds[1] >= 0)
|
||||
close(pipe_fds[1]);
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -427,17 +427,17 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
u->fd_type = 0;
|
||||
u->io_event = NULL;
|
||||
u->buf_fill = 0;
|
||||
|
||||
|
||||
if ((u->fd = start_client(PA_GCONF_HELPER, &u->pid)) < 0)
|
||||
goto fail;
|
||||
|
||||
|
||||
u->io_event = c->mainloop->io_new(
|
||||
c->mainloop,
|
||||
u->fd,
|
||||
PA_IO_EVENT_INPUT,
|
||||
io_event_cb,
|
||||
u);
|
||||
|
||||
|
||||
do {
|
||||
if ((r = handle_event(u)) < 0)
|
||||
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
|
||||
* initialization */
|
||||
} while (r != 1);
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ struct userdata {
|
|||
pa_hashmap *devices;
|
||||
#if defined(HAVE_ALSA) && defined(HAVE_OSS)
|
||||
int use_oss;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
struct timerdata {
|
||||
|
|
@ -269,7 +269,7 @@ static dbus_bool_t hal_device_add(struct userdata *u, const char *udi,
|
|||
case CAP_OSS:
|
||||
#ifdef HAVE_ALSA
|
||||
if (u->use_oss)
|
||||
#endif
|
||||
#endif
|
||||
m = hal_device_load_oss(u, udi, error);
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -533,9 +533,9 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
#endif
|
||||
#if defined(HAVE_ALSA) && defined(HAVE_OSS)
|
||||
u->use_oss = 0;
|
||||
|
||||
|
||||
if (n <= 0) {
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_OSS
|
||||
n += hal_device_add_all(u, CAP_OSS);
|
||||
#endif
|
||||
|
|
@ -546,7 +546,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
if (n > 0)
|
||||
u->use_oss = 1;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
libhal_ctx_set_user_data(hal_ctx, u);
|
||||
libhal_ctx_set_device_added(hal_ctx, device_added_cb);
|
||||
|
|
|
|||
|
|
@ -172,11 +172,11 @@ static void do_write(struct userdata *u) {
|
|||
|
||||
if (errno != EAGAIN) {
|
||||
pa_log("write() failed: %s", pa_cstrerror(errno));
|
||||
|
||||
|
||||
clear_up(u);
|
||||
pa_module_unload_request(u->module);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -228,14 +228,14 @@ static void do_read(struct userdata *u) {
|
|||
assert(memchunk.memblock);
|
||||
if ((r = pa_iochannel_read(u->io, memchunk.memblock->data, memchunk.memblock->length)) < 0) {
|
||||
pa_memblock_unref(memchunk.memblock);
|
||||
|
||||
|
||||
if (errno != EAGAIN) {
|
||||
pa_log("read() failed: %s", pa_cstrerror(errno));
|
||||
|
||||
|
||||
clear_up(u);
|
||||
pa_module_unload_request(u->module);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,17 +3,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
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;
|
||||
int64_t k, j, delta;
|
||||
struct timeval tv;
|
||||
|
||||
|
||||
assert(m);
|
||||
assert(e);
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!s->first_packet) {
|
||||
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;
|
||||
else
|
||||
delta = j;
|
||||
|
||||
|
||||
pa_memblockq_seek(s->memblockq, delta * s->rtp_context.frame_size, PA_SEEK_RELATIVE);
|
||||
|
||||
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_push(s->memblockq, &chunk);
|
||||
}
|
||||
|
||||
|
||||
/* The next timestamp we expect */
|
||||
s->offset = s->rtp_context.timestamp + (chunk.length / s->rtp_context.frame_size);
|
||||
|
||||
|
||||
pa_memblock_unref(chunk.memblock);
|
||||
|
||||
/* 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) {
|
||||
struct session *s = userdata;
|
||||
|
||||
|
||||
assert(m);
|
||||
assert(t);
|
||||
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) {
|
||||
int af, fd = -1, r, one;
|
||||
|
||||
|
||||
af = sa->sa_family;
|
||||
if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) {
|
||||
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));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
if (af == AF_INET) {
|
||||
struct ip_mreq 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));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
if (bind(fd, sa, salen) < 0) {
|
||||
pa_log("bind() failed: %s", pa_cstrerror(errno));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return fd;
|
||||
|
||||
|
||||
fail:
|
||||
if (fd >= 0)
|
||||
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.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
if (!(sink = pa_namereg_get(u->core, u->sink_name, PA_NAMEREG_SINK, 1))) {
|
||||
pa_log("sink does not exist.");
|
||||
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",
|
||||
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);
|
||||
|
|
@ -298,10 +298,10 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
|
|||
data.name = c;
|
||||
data.module = u->module;
|
||||
pa_sink_input_new_data_set_sample_spec(&data, &sdp_info->sample_spec);
|
||||
|
||||
|
||||
s->sink_input = pa_sink_input_new(u->core, &data, 0);
|
||||
pa_xfree(c);
|
||||
|
||||
|
||||
if (!s->sink_input) {
|
||||
pa_log("failed to create sink input.");
|
||||
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,
|
||||
(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));
|
||||
|
||||
|
||||
s->memblockq = pa_memblockq_new(
|
||||
0,
|
||||
MEMBLOCKQ_MAXLENGTH,
|
||||
|
|
@ -331,7 +331,7 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
|
|||
pa_memblock_unref(silence);
|
||||
|
||||
s->rtp_event = u->core->mainloop->io_new(u->core->mainloop, fd, PA_IO_EVENT_INPUT, rtp_event_cb, s);
|
||||
|
||||
|
||||
pa_gettimeofday(&tv);
|
||||
pa_timeval_add(&tv, DEATH_TIMEOUT);
|
||||
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);
|
||||
|
||||
u->n_sessions++;
|
||||
|
||||
|
||||
return s;
|
||||
|
||||
fail:
|
||||
if (s) {
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
|
||||
|
||||
pa_xfree(s);
|
||||
}
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ static void session_free(struct session *s, int from_hash) {
|
|||
|
||||
assert(s->userdata->n_sessions >= 1);
|
||||
s->userdata->n_sessions--;
|
||||
|
||||
|
||||
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;
|
||||
pa_sdp_info info;
|
||||
struct session *s;
|
||||
|
||||
|
||||
assert(m);
|
||||
assert(e);
|
||||
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 = session_new(u, &info)))
|
||||
pa_sdp_info_destroy(&info);
|
||||
|
||||
|
||||
} else {
|
||||
struct timeval tv;
|
||||
|
||||
|
||||
pa_gettimeofday(&tv);
|
||||
pa_timeval_add(&tv, DEATH_TIMEOUT);
|
||||
m->time_restart(s->death_event, &tv);
|
||||
|
||||
|
||||
pa_sdp_info_destroy(&info);
|
||||
}
|
||||
}
|
||||
|
|
@ -432,7 +432,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
socklen_t salen;
|
||||
const char *sap_address;
|
||||
int fd = -1;
|
||||
|
||||
|
||||
assert(c);
|
||||
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);
|
||||
|
||||
|
||||
if (inet_pton(AF_INET6, sap_address, &sa6.sin6_addr) > 0) {
|
||||
sa6.sin6_family = AF_INET6;
|
||||
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->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_modargs_free(ma);
|
||||
|
||||
return 0;
|
||||
|
|
@ -484,7 +484,7 @@ fail:
|
|||
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -504,7 +504,7 @@ void pa__done(pa_core *c, pa_module*m) {
|
|||
pa_sap_context_destroy(&u->sap_context);
|
||||
|
||||
pa_hashmap_free(u->by_origin, free_func, NULL);
|
||||
|
||||
|
||||
pa_xfree(u->sink_name);
|
||||
pa_xfree(u);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
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.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
struct userdata *u = userdata;
|
||||
struct timeval next;
|
||||
|
||||
|
||||
assert(m);
|
||||
assert(t);
|
||||
assert(tv);
|
||||
|
|
@ -172,7 +172,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
char hn[128], *n;
|
||||
int loop = 0;
|
||||
pa_source_output_new_data data;
|
||||
|
||||
|
||||
assert(c);
|
||||
assert(m);
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
payload = pa_rtp_payload_from_sample_spec(&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) {
|
||||
pa_log("invalid mtu.");
|
||||
goto fail;
|
||||
|
|
@ -241,7 +241,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
pa_log("invalid destination '%s'", dest);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) {
|
||||
pa_log("socket() failed: %s", pa_cstrerror(errno));
|
||||
goto fail;
|
||||
|
|
@ -275,7 +275,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
data.source = s;
|
||||
pa_source_output_new_data_set_sample_spec(&data, &ss);
|
||||
pa_source_output_new_data_set_channel_map(&data, &cm);
|
||||
|
||||
|
||||
if (!(o = pa_source_output_new(c, &data, 0))) {
|
||||
pa_log("failed to create source output.");
|
||||
goto fail;
|
||||
|
|
@ -284,7 +284,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
o->push = source_output_push;
|
||||
o->kill = source_output_kill;
|
||||
o->get_latency = source_output_get_latency;
|
||||
|
||||
|
||||
u = pa_xnew(struct userdata, 1);
|
||||
m->userdata = u;
|
||||
o->userdata = u;
|
||||
|
|
@ -292,7 +292,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
u->module = m;
|
||||
u->core = c;
|
||||
u->source_output = o;
|
||||
|
||||
|
||||
u->memblockq = pa_memblockq_new(
|
||||
0,
|
||||
MEMBLOCKQ_MAXLENGTH,
|
||||
|
|
@ -303,20 +303,20 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
NULL);
|
||||
|
||||
u->mtu = mtu;
|
||||
|
||||
|
||||
k = sizeof(sa_dst);
|
||||
r = getsockname(fd, (struct sockaddr*) &sa_dst, &k);
|
||||
assert(r >= 0);
|
||||
|
||||
n = pa_sprintf_malloc("PulseAudio RTP Stream on %s", pa_get_fqdn(hn, sizeof(hn)));
|
||||
|
||||
|
||||
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*) &sa4.sin_addr : (void*) &sa6.sin6_addr,
|
||||
n, port, payload, &ss);
|
||||
|
||||
pa_xfree(n);
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ fail:
|
|||
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
|
||||
|
||||
if (sap_fd >= 0)
|
||||
close(sap_fd);
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ fail:
|
|||
pa_source_output_disconnect(o);
|
||||
pa_source_output_unref(o);
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ void pa__done(pa_core *c, pa_module*m) {
|
|||
return;
|
||||
|
||||
c->mainloop->time_free(u->sap_event);
|
||||
|
||||
|
||||
if (u->source_output) {
|
||||
pa_source_output_disconnect(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_memblockq_free(u->memblockq);
|
||||
|
||||
|
||||
pa_xfree(u);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
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->payload = payload & 127;
|
||||
c->frame_size = frame_size;
|
||||
|
||||
|
||||
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];
|
||||
int iov_idx = 1;
|
||||
size_t n = 0, skip = 0;
|
||||
|
||||
|
||||
assert(c);
|
||||
assert(size > 0);
|
||||
assert(q);
|
||||
|
||||
if (pa_memblockq_get_length(q) < size)
|
||||
return 0;
|
||||
|
||||
|
||||
for (;;) {
|
||||
int r;
|
||||
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_len = sizeof(header);
|
||||
|
||||
|
||||
m.msg_name = NULL;
|
||||
m.msg_namelen = 0;
|
||||
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_controllen = 0;
|
||||
m.msg_flags = 0;
|
||||
|
||||
|
||||
k = sendmsg(c->fd, &m, MSG_DONTWAIT);
|
||||
|
||||
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;
|
||||
|
||||
c->timestamp += skip/c->frame_size;
|
||||
|
||||
|
||||
if (k < 0) {
|
||||
if (errno != EAGAIN) /* If the queue is full, just ignore it */
|
||||
pa_log("sendmsg() failed: %s", pa_cstrerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (r < 0 || pa_memblockq_get_length(q) < size)
|
||||
break;
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool) {
|
|||
uint32_t header;
|
||||
int cc;
|
||||
ssize_t r;
|
||||
|
||||
|
||||
assert(c);
|
||||
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_controllen = 0;
|
||||
m.msg_flags = 0;
|
||||
|
||||
|
||||
if ((r = recvmsg(c->fd, &m, 0)) != size) {
|
||||
pa_log("recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch");
|
||||
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(&c->timestamp, (uint8_t*) chunk->memblock->data + 4, sizeof(uint32_t));
|
||||
memcpy(&c->ssrc, (uint8_t*) chunk->memblock->data + 8, sizeof(uint32_t));
|
||||
|
||||
|
||||
header = ntohl(header);
|
||||
c->timestamp = ntohl(c->timestamp);
|
||||
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.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
|
@ -255,7 +255,7 @@ uint8_t pa_rtp_payload_from_sample_spec(const pa_sample_spec *ss) {
|
|||
return 10;
|
||||
if (ss->format == PA_SAMPLE_S16BE && ss->rate == 44100 && ss->channels == 1)
|
||||
return 11;
|
||||
|
||||
|
||||
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->rate = 44100;
|
||||
break;
|
||||
|
||||
|
||||
case 11:
|
||||
ss->channels = 1;
|
||||
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) {
|
||||
assert(s);
|
||||
|
||||
|
||||
if (!(strcmp(s, "L16")))
|
||||
return PA_SAMPLE_S16BE;
|
||||
else if (!strcmp(s, "L8"))
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
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->sdp_data = sdp_data;
|
||||
c->msg_id_hash = (uint16_t) (rand()*rand());
|
||||
|
||||
return c;
|
||||
|
||||
return 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);
|
||||
|
||||
|
||||
header = htonl(((uint32_t) 1 << 29) |
|
||||
(sa->sa_family == AF_INET6 ? (uint32_t) 1 << 28 : 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_len = strlen(c->sdp_data);
|
||||
|
||||
|
||||
m.msg_name = NULL;
|
||||
m.msg_namelen = 0;
|
||||
m.msg_iov = iov;
|
||||
|
|
@ -111,7 +111,7 @@ int pa_sap_send(pa_sap_context *c, int goodbye) {
|
|||
m.msg_control = NULL;
|
||||
m.msg_controllen = 0;
|
||||
m.msg_flags = 0;
|
||||
|
||||
|
||||
if ((k = sendmsg(c->fd, &m, MSG_DONTWAIT)) < 0)
|
||||
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;
|
||||
int six, ac;
|
||||
ssize_t r;
|
||||
|
||||
|
||||
assert(c);
|
||||
assert(goodbye);
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ int pa_sap_recv(pa_sap_context *c, int *goodbye) {
|
|||
|
||||
buf = pa_xnew(char, size+1);
|
||||
buf[size] = 0;
|
||||
|
||||
|
||||
iov.iov_base = buf;
|
||||
iov.iov_len = size;
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ int pa_sap_recv(pa_sap_context *c, int *goodbye) {
|
|||
m.msg_control = NULL;
|
||||
m.msg_controllen = 0;
|
||||
m.msg_flags = 0;
|
||||
|
||||
|
||||
if ((r = recvmsg(c->fd, &m, 0)) != size) {
|
||||
pa_log("recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch");
|
||||
goto fail;
|
||||
|
|
@ -208,12 +208,12 @@ int pa_sap_recv(pa_sap_context *c, int *goodbye) {
|
|||
|
||||
if (c->sdp_data)
|
||||
pa_xfree(c->sdp_data);
|
||||
|
||||
|
||||
c->sdp_data = pa_xstrndup(e, size);
|
||||
pa_xfree(buf);
|
||||
|
||||
|
||||
*goodbye = !!((header >> 26) & 1);
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
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);
|
||||
assert(f);
|
||||
|
||||
|
||||
if (!(u = getenv("USER")))
|
||||
if (!(u = getenv("USERNAME")))
|
||||
u = "-";
|
||||
|
||||
|
||||
ntp = time(NULL) + 2208988800U;
|
||||
|
||||
a = inet_ntop(af, src, buf_src, sizeof(buf_src));
|
||||
assert(a);
|
||||
a = inet_ntop(af, dst, buf_dst, sizeof(buf_dst));
|
||||
assert(a);
|
||||
|
||||
|
||||
return pa_sprintf_malloc(
|
||||
PA_SDP_HEADER
|
||||
"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(i);
|
||||
|
||||
|
||||
i->origin = i->session_name = NULL;
|
||||
i->salen = 0;
|
||||
i->payload = 255;
|
||||
|
||||
|
||||
if (!pa_startswith(t, PA_SDP_HEADER)) {
|
||||
pa_log("Failed to parse SDP data: invalid header.");
|
||||
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;
|
||||
|
||||
k = l-8 > sizeof(a) ? sizeof(a) : l-8;
|
||||
|
||||
|
||||
pa_strlcpy(a, t+9, k);
|
||||
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;
|
||||
|
||||
k = l-8 > sizeof(a) ? sizeof(a) : l-8;
|
||||
|
||||
|
||||
pa_strlcpy(a, t+9, k);
|
||||
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) {
|
||||
int _port, _payload;
|
||||
|
||||
|
||||
if (sscanf(t+8, "%i RTP/AVP %i", &_port, &_payload) == 2) {
|
||||
|
||||
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) {
|
||||
|
||||
c[strcspn(c, "\n")] = 0;
|
||||
|
||||
|
||||
if (parse_sdp_sample_spec(&i->sample_spec, c))
|
||||
ss_valid = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
t += l;
|
||||
|
||||
|
||||
if (*t == '\n')
|
||||
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);
|
||||
else
|
||||
((struct sockaddr_in6*) &i->sa)->sin6_port = htons(port);
|
||||
|
||||
|
||||
return i;
|
||||
|
||||
fail:
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@
|
|||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2006 Lennart Poettering
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
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.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
return 0;
|
||||
|
||||
|
||||
|
||||
l = strcspn(cs, whitespace);
|
||||
|
||||
|
||||
for (command = commands; command->name; command++)
|
||||
if (strlen(command->name) == l && !strncmp(cs, command->name, l)) {
|
||||
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;
|
||||
int ifstate = IFSTATE_NONE;
|
||||
int ret = -1;
|
||||
|
||||
|
||||
assert(c);
|
||||
assert(fn);
|
||||
assert(buf);
|
||||
|
|
@ -1103,7 +1103,7 @@ fail:
|
|||
int pa_cli_command_execute(pa_core *c, const char *s, pa_strbuf *buf, int *fail) {
|
||||
const char *p;
|
||||
int ifstate = IFSTATE_NONE;
|
||||
|
||||
|
||||
assert(c);
|
||||
assert(s);
|
||||
assert(buf);
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ void pa_raise_priority(void) {
|
|||
if ((caps = cap_get_proc())) {
|
||||
cap_t caps_new;
|
||||
cap_value_t nice_cap = CAP_SYS_NICE;
|
||||
|
||||
|
||||
if ((caps_new = cap_dup(caps))) {
|
||||
cap_set_flag(caps_new, CAP_EFFECTIVE, 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
|
||||
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
if (setpriority(PRIO_PROCESS, 0, NICE_LEVEL) < 0)
|
||||
pa_log_warn("setpriority(): %s", pa_cstrerror(errno));
|
||||
|
|
|
|||
5062
src/pulsecore/g711.c
5062
src/pulsecore/g711.c
File diff suppressed because it is too large
Load diff
|
|
@ -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, maxlength > 0 && maxlength <= MAX_MEMBLOCKQ_LENGTH, tag, PA_ERR_INVALID);
|
||||
CHECK_VALIDITY(c->pstream, maxlength >= pa_frame_size(&ss), tag, PA_ERR_INVALID);
|
||||
|
||||
|
||||
if (sink_index != PA_INVALID_INDEX) {
|
||||
sink = pa_idxset_get_by_index(c->protocol->core->sinks, sink_index);
|
||||
CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ pa_memblock *pa_silence_memblock_new(pa_mempool *pool, const pa_sample_spec *spe
|
|||
|
||||
if (length <= 0)
|
||||
length = fs;
|
||||
|
||||
|
||||
return pa_silence_memblock(pa_memblock_new(pool, length), spec);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
assert(t);
|
||||
|
||||
|
||||
/* Unfortunately there is no way to tell whether a "foreign"
|
||||
* thread is still running. See
|
||||
* http://udrepper.livejournal.com/16844.html for more
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
/* this is a no-op */
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
debug(DEBUG_LEVEL_NORMAL, __FILE__": unknown ioctl 0x%08lx\n", request);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue