[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test2-74-g2e250aa
Lennart Poettering
gitmailer-noreply at 0pointer.de
Wed Feb 18 20:17:32 PST 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 205b0ba08e1f796481e0bba11c0813266af3947f (commit)
- Log -----------------------------------------------------------------
2e250aa... Merge commit '38ded3bb31bc49664641965f856a35f432a8a956'
b0c0106... Merge commit 'elmarco/legacy-dir'
7c78c3f... alsa-util: check if mixer_poll_descriptors_count() < 0
800489e... pulsecore: don't leak p when make_random_dir_and_link()
f1dcbe0... pulsecore: don't leak d in case of error
4722fec... rtp: remove unused variable a
88fc458... protocol-native: don't leak a proplist
0684b23... stream-resotre: don't leak a name
c0cf22d... protocol-esound: don't accept a request of PROTOCOL_MAX
2c6abb8... daemon-conf: make sure c->log_level < LEVEL_MAX
4f1380b... pulsecore: use r returned from fgets()
204083c... pulsecore: unused variable e in hashmap_put()
60d53c6... tests/ipacl-test: check inet_pton()
bb52a67... padsp: don't use si if it's NULL
d1306e3... pulsecore: fix check for cb (m is already checked before)
67b0bae... pacat: remove unused variable
4512a2c... rtp-recv: remove unused variable assignment
927e501... pulsecore: remove unused variable from cli_command_load()
a252b61... main: remove unused lf variable
c3eb908... pactl: return in case of error reading file (avoid using freed d)
25bbea6... tests/thread-mainloop-test: check if threaded_mainloop_start() succeed
5ea7dac... tests/interpol-test: check if mainloop_start() succeed
a836927... tests/sync-playback: check if pa_context_connect succeed
93ed27d... pactl: check if pa_context_connect succeed
2aeab75... paplay: check if pa_context_connect() succeed
6c8d851... protocol-native: fix get_info() for cards
01f81d6... card-restore: it's not useful to check an array, let's check the length
ee0b5f7... log: don't leak bt
83cdcf2... alsa-util: make sure we check an initialized cn variable
7737b10... hal-detect: make sure r is initialized, so we don't take random path
7d16dcb... dbus-util: avoid double free
05b7440... pulse/context: add --enable-legacy-runtime-dir
38ded3b... bluetooth: print SBC encoder implementation info
b4c391e... bluetooth: don't crash on pa_thread_mq_done() if pa_init() fail
b51e613... bluetooth: update SBC from upstream
0b8a6c6... bluetooth: fix message queue/rtpoll
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 6 ++++
src/daemon/daemon-conf.c | 2 +-
src/daemon/main.c | 4 ---
src/modules/alsa/alsa-util.c | 12 ++++++---
src/modules/bluetooth/module-bluetooth-device.c | 25 +++++++++++-------
src/modules/bluetooth/sbc.c | 18 ++++++++++++-
src/modules/bluetooth/sbc.h | 1 +
src/modules/bluetooth/sbc_primitives.c | 1 +
src/modules/bluetooth/sbc_primitives.h | 1 +
src/modules/bluetooth/sbc_primitives_mmx.c | 1 +
src/modules/bluetooth/sbc_primitives_neon.c | 1 +
src/modules/dbus-util.c | 3 +-
src/modules/module-card-restore.c | 2 +-
src/modules/module-hal-detect.c | 1 +
src/modules/module-stream-restore.c | 2 +
src/modules/rtp/module-rtp-recv.c | 2 +-
src/modules/rtp/sdp.c | 6 ++--
src/pulse/context.c | 6 ++++-
src/pulsecore/cli-command.c | 3 +-
src/pulsecore/core-util.c | 4 ++-
src/pulsecore/hashmap.c | 2 +-
src/pulsecore/log.c | 1 +
src/pulsecore/protocol-esound.c | 2 +-
src/pulsecore/protocol-native.c | 30 +++++++++++++++-------
src/tests/interpol-test.c | 3 +-
src/tests/ipacl-test.c | 3 +-
src/tests/sync-playback.c | 7 ++++-
src/tests/thread-mainloop-test.c | 2 +-
src/utils/pacat.c | 3 +-
src/utils/pactl.c | 6 ++++-
src/utils/padsp.c | 4 +-
src/utils/paplay.c | 5 +++-
32 files changed, 115 insertions(+), 54 deletions(-)
-----------------------------------------------------------------------
commit 0b8a6c66dc0dec79110f40ffa6ee791b4c557ca8
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Feb 13 00:14:48 2009 +0200
bluetooth: fix message queue/rtpoll
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 6daae83..35338dc 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1349,9 +1349,6 @@ static int add_sink(struct userdata *u) {
u->sink->userdata = u;
u->sink->parent.process_msg = sink_process_msg;
-
- pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
- pa_sink_set_rtpoll(u->sink, u->rtpoll);
}
/* u->sink->get_volume = sink_get_volume_cb; */
@@ -1396,9 +1393,6 @@ static int add_source(struct userdata *u) {
u->source->userdata = u;
u->source->parent.process_msg = source_process_msg;
-
- pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
- pa_source_set_rtpoll(u->source, u->rtpoll);
}
/* u->source->get_volume = source_get_volume_cb; */
@@ -1559,11 +1553,17 @@ static int start_thread(struct userdata *u) {
return -1;
}
- if (u->sink)
+ if (u->sink) {
+ pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
+ pa_sink_set_rtpoll(u->sink, u->rtpoll);
pa_sink_put(u->sink);
+ }
- if (u->source)
+ if (u->source) {
+ pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
+ pa_source_set_rtpoll(u->source, u->rtpoll);
pa_source_put(u->source);
+ }
return 0;
}
commit b51e6135e87221b05acb1e8796d28bec1cf06dff
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 15:20:08 2009 +0200
bluetooth: update SBC from upstream
diff --git a/src/modules/bluetooth/sbc.c b/src/modules/bluetooth/sbc.c
index 29258d0..a33ed57 100644
--- a/src/modules/bluetooth/sbc.c
+++ b/src/modules/bluetooth/sbc.c
@@ -985,7 +985,7 @@ int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,
char *ptr;
int i, ch, framelen, samples;
- if (!sbc && !input)
+ if (!sbc || !input)
return -EIO;
priv = sbc->priv;
@@ -1053,7 +1053,7 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE],
int nsamples, int nchannels);
- if (!sbc && !input)
+ if (!sbc || !input)
return -EIO;
priv = sbc->priv;
@@ -1221,6 +1221,20 @@ uint16_t sbc_get_codesize(sbc_t *sbc)
return subbands * blocks * channels * 2;
}
+const char *sbc_get_implementation_info(sbc_t *sbc)
+{
+ struct sbc_priv *priv;
+
+ if (!sbc)
+ return NULL;
+
+ priv = sbc->priv;
+ if (!priv)
+ return NULL;
+
+ return priv->enc_state.implementation_info;
+}
+
int sbc_reinit(sbc_t *sbc, unsigned long flags)
{
struct sbc_priv *priv;
diff --git a/src/modules/bluetooth/sbc.h b/src/modules/bluetooth/sbc.h
index b0a1488..f9d506b 100644
--- a/src/modules/bluetooth/sbc.h
+++ b/src/modules/bluetooth/sbc.h
@@ -89,6 +89,7 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
int sbc_get_frame_length(sbc_t *sbc);
int sbc_get_frame_duration(sbc_t *sbc);
uint16_t sbc_get_codesize(sbc_t *sbc);
+const char *sbc_get_implementation_info(sbc_t *sbc);
void sbc_finish(sbc_t *sbc);
#ifdef __cplusplus
diff --git a/src/modules/bluetooth/sbc_primitives.c b/src/modules/bluetooth/sbc_primitives.c
index 303f3fe..6b0be3f 100644
--- a/src/modules/bluetooth/sbc_primitives.c
+++ b/src/modules/bluetooth/sbc_primitives.c
@@ -456,6 +456,7 @@ void sbc_init_primitives(struct sbc_encoder_state *state)
/* Default implementation for scale factors calculation */
state->sbc_calc_scalefactors = sbc_calc_scalefactors;
+ state->implementation_info = "Generic C";
/* X86/AMD64 optimizations */
#ifdef SBC_BUILD_WITH_MMX_SUPPORT
diff --git a/src/modules/bluetooth/sbc_primitives.h b/src/modules/bluetooth/sbc_primitives.h
index 2708c82..3d01c11 100644
--- a/src/modules/bluetooth/sbc_primitives.h
+++ b/src/modules/bluetooth/sbc_primitives.h
@@ -62,6 +62,7 @@ struct sbc_encoder_state {
void (*sbc_calc_scalefactors)(int32_t sb_sample_f[16][2][8],
uint32_t scale_factor[2][8],
int blocks, int channels, int subbands);
+ const char *implementation_info;
};
/*
diff --git a/src/modules/bluetooth/sbc_primitives_mmx.c b/src/modules/bluetooth/sbc_primitives_mmx.c
index 1870a9b..08e9ca2 100644
--- a/src/modules/bluetooth/sbc_primitives_mmx.c
+++ b/src/modules/bluetooth/sbc_primitives_mmx.c
@@ -313,6 +313,7 @@ void sbc_init_primitives_mmx(struct sbc_encoder_state *state)
if (check_mmx_support()) {
state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_mmx;
state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_mmx;
+ state->implementation_info = "MMX";
}
}
diff --git a/src/modules/bluetooth/sbc_primitives_neon.c b/src/modules/bluetooth/sbc_primitives_neon.c
index d9c12f9..f1bc7b4 100644
--- a/src/modules/bluetooth/sbc_primitives_neon.c
+++ b/src/modules/bluetooth/sbc_primitives_neon.c
@@ -240,6 +240,7 @@ void sbc_init_primitives_neon(struct sbc_encoder_state *state)
{
state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_neon;
state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_neon;
+ state->implementation_info = "NEON";
}
#endif
commit b4c391ee5eaa61c31fa297b6b3f6e3a65d662948
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Fri Feb 13 12:18:14 2009 +0200
bluetooth: don't crash on pa_thread_mq_done() if pa_init() fail
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 35338dc..748a2d4 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1517,9 +1517,9 @@ static void stop_thread(struct userdata *u) {
u->source = NULL;
}
- pa_thread_mq_done(&u->thread_mq);
-
if (u->rtpoll) {
+ pa_thread_mq_done(&u->thread_mq);
+
pa_rtpoll_free(u->rtpoll);
u->rtpoll = NULL;
}
commit 38ded3bb31bc49664641965f856a35f432a8a956
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Fri Feb 13 15:09:16 2009 +0200
bluetooth: print SBC encoder implementation info
The encoder initialization is done lazily, so we can only get the
information once encoding start. This is abit annoying..
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 748a2d4..b8f6729 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -904,6 +904,11 @@ static int a2dp_process_render(struct userdata *u) {
(void*) p, u->write_memchunk.length,
d, left,
&written);
+
+ PA_ONCE_BEGIN {
+ pa_log_debug("Using SBC encoder implementation: %s", pa_strnull(sbc_get_implementation_info(&a2dp->sbc)));
+ } PA_ONCE_END;
+
pa_memblock_release(u->write_memchunk.memblock);
if (encoded <= 0) {
commit 05b74404813931744e1479c96f039ae2a79b0c7d
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 16:51:37 2009 +0200
pulse/context: add --enable-legacy-runtime-dir
diff --git a/configure.ac b/configure.ac
index c28a72c..2ac40cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1220,6 +1220,12 @@ AC_SUBST(PA_SYSTEM_STATE_PATH)
# Output #
###################################
+AC_ARG_ENABLE([legacy-runtime-dir],
+ AS_HELP_STRING([--disable-legacy-runtime-dir], [Try to connect on legacy (< 0.9.12) socket paths.]))
+if test "x$enable_legacy_runtime_dir" != "xno" ; then
+ AC_DEFINE(ENABLE_LEGACY_RUNTIME_DIR, [1], [Legacy runtime dir])
+fi
+
AC_ARG_ENABLE(
[static-bins],
AS_HELP_STRING([--enable-static-bins],[Statically link executables.]),
diff --git a/src/pulse/context.c b/src/pulse/context.c
index 8686e0d..9cc1ea7 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -555,6 +555,7 @@ static void setup_context(pa_context *c, pa_iochannel *io) {
pa_context_unref(c);
}
+#if ENABLE_LEGACY_RUNTIME_DIR
static char *get_old_legacy_runtime_dir(void) {
char *p, u[128];
struct stat st;
@@ -598,10 +599,12 @@ static char *get_very_old_legacy_runtime_dir(void) {
return p;
}
-
+#endif
static pa_strlist *prepend_per_user(pa_strlist *l) {
char *ufn;
+
+#if ENABLE_LEGACY_RUNTIME_DIR
static char *legacy_dir;
/* The very old per-user instance path (< 0.9.11). This is supported only to ease upgrades */
@@ -619,6 +622,7 @@ static pa_strlist *prepend_per_user(pa_strlist *l) {
pa_xfree(p);
pa_xfree(legacy_dir);
}
+#endif
/* The per-user instance */
if ((ufn = pa_runtime_path(PA_NATIVE_DEFAULT_UNIX_SOCKET))) {
commit 7d16dcb6cc8dc931020186f5dab37f32ecc815d9
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 19:19:07 2009 +0200
dbus-util: avoid double free
diff --git a/src/modules/dbus-util.c b/src/modules/dbus-util.c
index f6a986a..4218bca 100644
--- a/src/modules/dbus-util.c
+++ b/src/modules/dbus-util.c
@@ -403,8 +403,7 @@ void pa_dbus_pending_free(pa_dbus_pending *p) {
pa_assert(p);
if (p->pending) {
- dbus_pending_call_cancel(p->pending);
- dbus_pending_call_unref(p->pending);
+ dbus_pending_call_cancel(p->pending); /* p->pending is freed by cancel() */
}
if (p->message)
commit 7737b10ac6cd03d844c6de77c58f2d39b60a7ad3
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 19:26:21 2009 +0200
hal-detect: make sure r is initialized, so we don't take random path
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index e603738..ce04f36 100644
--- a/src/modules/module-hal-detect.c
+++ b/src/modules/module-hal-detect.c
@@ -370,6 +370,7 @@ static struct device* hal_device_add(struct userdata *u, const char *udi) {
d->originating_udi = NULL;
d->module = PA_INVALID_INDEX;
d->sink_name = d->source_name = d->card_name = NULL;
+ r = -1;
#ifdef HAVE_ALSA
if (pa_streq(u->capability, CAPABILITY_ALSA))
commit 83cdcf2f53f4a449cd4d6eb67c1e079a5db0257a
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 19:35:01 2009 +0200
alsa-util: make sure we check an initialized cn variable
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 1bb7ddf..c53fd10 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -1,7 +1,7 @@
/***
This file is part of PulseAudio.
- Copyright 2004-2006 Lennart Poettering
+ Copyright 2004-2009 Lennart Poettering
Copyright 2006 Pierre Ossman <ossman at cendio.se> for Cendio AB
PulseAudio is free software; you can redistribute it and/or modify
@@ -1388,7 +1388,7 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *
snd_pcm_class_t class;
snd_pcm_subclass_t subclass;
- const char *n, *id, *sdn, *cn;
+ const char *n, *id, *sdn, *cn = NULL;
int card;
pa_assert(p);
commit ee0b5f71861f3ebad0c24f8c27000210fd986e54
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:06:35 2009 +0200
log: don't leak bt
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index 1ae4383..89b75da 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -351,6 +351,7 @@ void pa_log_levelv_meta(
}
errno = saved_errno;
+ pa_xfree(bt);
}
void pa_log_level_meta(
commit 01f81d697346d3cb052d11137913aaa59a854c0b
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Thu Feb 19 04:49:58 2009 +0100
card-restore: it's not useful to check an array, let's check the length
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 909c095..c769605 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -191,7 +191,7 @@ static pa_hook_result_t card_new_hook_callback(pa_core *c, pa_card_new_data *new
pa_assert(new_data);
- if ((e = read_entry(u, new_data->name)) && e->profile) {
+ if ((e = read_entry(u, new_data->name)) && e->profile[0]) {
if (!new_data->active_profile) {
pa_card_new_data_set_profile(new_data, e->profile);
commit 6c8d851643a8413678c7557abc9758cc1bee94c0
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:18:56 2009 +0200
protocol-native: fix get_info() for cards
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 79b9b06..39b8282 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -3011,7 +3011,7 @@ static void command_get_info(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
source_fill_tagstruct(c, reply, source);
else if (client)
client_fill_tagstruct(c, reply, client);
- else if (client)
+ else if (card)
card_fill_tagstruct(c, reply, card);
else if (module)
module_fill_tagstruct(c, reply, module);
commit 2aeab75c6893c882800975866178c79dfe85202a
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:27:45 2009 +0200
paplay: check if pa_context_connect() succeed
diff --git a/src/utils/paplay.c b/src/utils/paplay.c
index df2edf6..dec80e5 100644
--- a/src/utils/paplay.c
+++ b/src/utils/paplay.c
@@ -400,7 +400,10 @@ int main(int argc, char *argv[]) {
pa_context_set_state_callback(context, context_state_callback, NULL);
/* Connect the context */
- pa_context_connect(context, server, 0, NULL);
+ if (pa_context_connect(context, server, 0, NULL) < 0) {
+ fprintf(stderr, _("pa_context_connect() failed: %s"), pa_strerror(pa_context_errno(context)));
+ goto quit;
+ }
/* Run the main loop */
if (pa_mainloop_run(m, &ret) < 0) {
commit 93ed27d5617202441bd9be346ce916289fe7128d
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:31:06 2009 +0200
pactl: check if pa_context_connect succeed
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 154e7f9..e020f37 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -1029,7 +1029,10 @@ int main(int argc, char *argv[]) {
}
pa_context_set_state_callback(context, context_state_callback, NULL);
- pa_context_connect(context, server, 0, NULL);
+ if (pa_context_connect(context, server, 0, NULL) < 0) {
+ fprintf(stderr, _("pa_context_connect() failed: %s"), pa_strerror(pa_context_errno(context)));
+ goto quit;
+ }
if (pa_mainloop_run(m, &ret) < 0) {
fprintf(stderr, _("pa_mainloop_run() failed.\n"));
commit a8369274952ad81ed2b05800d182e35efd26e41d
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:34:05 2009 +0200
tests/sync-playback: check if pa_context_connect succeed
diff --git a/src/tests/sync-playback.c b/src/tests/sync-playback.c
index 42c479a..f2a1560 100644
--- a/src/tests/sync-playback.c
+++ b/src/tests/sync-playback.c
@@ -174,11 +174,16 @@ int main(int argc, char *argv[]) {
pa_context_set_state_callback(context, context_state_callback, NULL);
- pa_context_connect(context, NULL, 0, NULL);
+ /* Connect the context */
+ if (pa_context_connect(context, NULL, 0, NULL) < 0) {
+ fprintf(stderr, "pa_context_connect() failed.\n");
+ goto quit;
+ }
if (pa_mainloop_run(m, &ret) < 0)
fprintf(stderr, "pa_mainloop_run() failed.\n");
+quit:
pa_context_unref(context);
for (i = 0; i < NSTREAMS; i++)
commit 5ea7dac11c225aa26367974d7cf37e71a096ef27
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:36:38 2009 +0200
tests/interpol-test: check if mainloop_start() succeed
diff --git a/src/tests/interpol-test.c b/src/tests/interpol-test.c
index 20d2c23..d7da660 100644
--- a/src/tests/interpol-test.c
+++ b/src/tests/interpol-test.c
@@ -126,7 +126,8 @@ int main(int argc, char *argv[]) {
pa_gettimeofday(&start);
- pa_threaded_mainloop_start(m);
+ r = pa_threaded_mainloop_start(m);
+ assert(r >= 0);
for (k = 0; k < 5000; k++) {
pa_bool_t success = FALSE, changed = FALSE;
commit 25bbea67492cb7c6e9b8e78beb6553864c290a1a
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:38:51 2009 +0200
tests/thread-mainloop-test: check if threaded_mainloop_start() succeed
diff --git a/src/tests/thread-mainloop-test.c b/src/tests/thread-mainloop-test.c
index 263cd57..3bcf4f1 100644
--- a/src/tests/thread-mainloop-test.c
+++ b/src/tests/thread-mainloop-test.c
@@ -47,7 +47,7 @@ int main(int argc, char *argv[]) {
pa_assert_se(m = pa_threaded_mainloop_new());
pa_assert_se(a = pa_threaded_mainloop_get_api(m));
- pa_threaded_mainloop_start(m);
+ pa_assert_se(pa_threaded_mainloop_start(m) >= 0);
pa_threaded_mainloop_lock(m);
commit c3eb9086b819eb7abb0248e0a253c21e5853fe99
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 20:52:11 2009 +0200
pactl: return in case of error reading file (avoid using freed d)
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index e020f37..d3da90e 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -649,6 +649,7 @@ static void stream_write_callback(pa_stream *s, size_t length, void *userdata) {
pa_xfree(d);
fprintf(stderr, _("Premature end of file\n"));
quit(1);
+ return;
}
pa_stream_write(s, d, length, pa_xfree, 0, PA_SEEK_RELATIVE);
commit a252b61be1d81f833a3cca87a2294d7fe65532fd
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 21:59:45 2009 +0200
main: remove unused lf variable
diff --git a/src/daemon/main.c b/src/daemon/main.c
index d3e02fa..5f94ec6 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -348,7 +348,6 @@ int main(int argc, char *argv[]) {
pa_time_event *win32_timer;
struct timeval win32_tv;
#endif
- char *lf = NULL;
int autospawn_fd = -1;
pa_bool_t autospawn_locked = FALSE;
@@ -1000,9 +999,6 @@ finish:
pa_autospawn_lock_done(FALSE);
}
- if (lf)
- pa_xfree(lf);
-
#ifdef OS_IS_WIN32
if (win32_timer)
pa_mainloop_get_api(mainloop)->time_free(win32_timer);
commit 927e501920f629eca1f73627b0d7a5a03a9e8bdc
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 22:07:57 2009 +0200
pulsecore: remove unused variable from cli_command_load()
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 1df0bd6..5e45c1a 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -401,7 +401,6 @@ static int pa_cli_command_info(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
}
static int pa_cli_command_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
- pa_module *m;
const char *name;
pa_core_assert_ref(c);
@@ -414,7 +413,7 @@ static int pa_cli_command_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
return -1;
}
- if (!(m = pa_module_load(c, name, pa_tokenizer_get(t, 2)))) {
+ if (!pa_module_load(c, name, pa_tokenizer_get(t, 2))) {
pa_strbuf_puts(buf, "Module load failed.\n");
return -1;
}
commit 4512a2ce9ce15bdcded9d5aa457016716edd459a
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 22:06:25 2009 +0200
rtp-recv: remove unused variable assignment
diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
index 063ba72..0d86459 100644
--- a/src/modules/rtp/module-rtp-recv.c
+++ b/src/modules/rtp/module-rtp-recv.c
@@ -562,7 +562,7 @@ static void sap_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event
} else {
if (!(s = pa_hashmap_get(u->by_origin, info.origin))) {
- if (!(s = session_new(u, &info)))
+ if (!session_new(u, &info))
pa_sdp_info_destroy(&info);
} else {
commit 67b0baecc41745afcf8591949fbdffb8678fe83f
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 22:17:10 2009 +0200
pacat: remove unused variable
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 10015ce..2224da9 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -336,7 +336,6 @@ static void context_drain_complete(pa_context*c, void *userdata) {
/* Stream draining complete */
static void stream_drain_complete(pa_stream*s, int success, void *userdata) {
- pa_operation *o;
if (!success) {
fprintf(stderr, _("Failed to drain stream: %s\n"), pa_strerror(pa_context_errno(context)));
@@ -350,7 +349,7 @@ static void stream_drain_complete(pa_stream*s, int success, void *userdata) {
pa_stream_unref(stream);
stream = NULL;
- if (!(o = pa_context_drain(context, context_drain_complete, NULL)))
+ if (!pa_context_drain(context, context_drain_complete, NULL))
pa_context_disconnect(context);
else {
if (verbose)
commit d1306e3020137251fc0aa57386dd79ee1ec5ebb0
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 22:32:40 2009 +0200
pulsecore: fix check for cb (m is already checked before)
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 39b8282..59fae98 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -4070,7 +4070,7 @@ static void command_extension(pa_pdispatch *pd, uint32_t command, uint32_t tag,
CHECK_VALIDITY(c->pstream, m->load_once || idx != PA_INVALID_INDEX, tag, PA_ERR_INVALID);
cb = (pa_native_protocol_ext_cb_t) (unsigned long) pa_hashmap_get(c->protocol->extensions, m);
- CHECK_VALIDITY(c->pstream, m, tag, PA_ERR_NOEXTENSION);
+ CHECK_VALIDITY(c->pstream, cb, tag, PA_ERR_NOEXTENSION);
if (cb(c->protocol, m, c, tag, t) < 0)
protocol_error(c);
commit bb52a6753b907e18b0de31bffd424b8ed273c5a9
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 22:37:16 2009 +0200
padsp: don't use si if it's NULL
diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index 046bae4..76e86c8 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -1202,7 +1202,7 @@ fail:
static void sink_info_cb(pa_context *context, const pa_sink_info *si, int eol, void *userdata) {
fd_info *i = userdata;
- if (!si && eol < 0) {
+ if (!si || eol < 0) {
i->operation_success = 0;
pa_threaded_mainloop_signal(i->mainloop, 0);
return;
@@ -1224,7 +1224,7 @@ static void sink_info_cb(pa_context *context, const pa_sink_info *si, int eol, v
static void source_info_cb(pa_context *context, const pa_source_info *si, int eol, void *userdata) {
fd_info *i = userdata;
- if (!si && eol < 0) {
+ if (!si || eol < 0) {
i->operation_success = 0;
pa_threaded_mainloop_signal(i->mainloop, 0);
return;
commit 60d53c6523dfd59fbcc99ff443ba993e285ca366
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Tue Feb 17 22:58:59 2009 +0200
tests/ipacl-test: check inet_pton()
diff --git a/src/tests/ipacl-test.c b/src/tests/ipacl-test.c
index 7b7564a..f89665c 100644
--- a/src/tests/ipacl-test.c
+++ b/src/tests/ipacl-test.c
@@ -25,6 +25,7 @@
#endif
#include "../pulsecore/winsock.h"
+#include "../pulsecore/macro.h"
#include <pulsecore/ipacl.h>
@@ -96,7 +97,7 @@ int main(int argc, char *argv[]) {
memset(&sa6, 0, sizeof(sa6));
sa6.sin6_family = AF_INET6;
sa6.sin6_port = htons(22);
- inet_pton(AF_INET6, "::1", &sa6.sin6_addr);
+ pa_assert_se(inet_pton(AF_INET6, "::1", &sa6.sin6_addr) == 1);
r = connect(fd, (struct sockaddr*) &sa6, sizeof(sa6));
assert(r >= 0);
commit 204083cb325ba3db09ca75b70e9d3d6adfb67e0d
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 18:16:45 2009 +0200
pulsecore: unused variable e in hashmap_put()
diff --git a/src/pulsecore/hashmap.c b/src/pulsecore/hashmap.c
index 3c6f41e..57607b6 100644
--- a/src/pulsecore/hashmap.c
+++ b/src/pulsecore/hashmap.c
@@ -138,7 +138,7 @@ int pa_hashmap_put(pa_hashmap *h, const void *key, void *value) {
hash = h->hash_func(key) % NBUCKETS;
- if ((e = hash_scan(h, hash, key)))
+ if (hash_scan(h, hash, key))
return -1;
if (!(e = pa_flist_pop(PA_STATIC_FLIST_GET(entries))))
commit 4f1380b7138d5862e8f12c9060ef46f0355c160b
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 18:21:25 2009 +0200
pulsecore: use r returned from fgets()
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 61f9a65..432ee3b 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2459,7 +2459,7 @@ char *pa_machine_id(void) {
pa_strip_nl(ln);
- if (ln[0])
+ if (r && ln[0])
return pa_xstrdup(ln);
}
commit 2c6abb87938d2172963a99979449c1ff0b63a9f3
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 19:15:43 2009 +0200
daemon-conf: make sure c->log_level < LEVEL_MAX
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 7d3b89f..7dfef27 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -639,7 +639,7 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
if (c->config_file)
pa_strbuf_printf(s, _("### Read from configuration file: %s ###\n"), c->config_file);
- pa_assert(c->log_level <= PA_LOG_LEVEL_MAX);
+ pa_assert(c->log_level < PA_LOG_LEVEL_MAX);
pa_strbuf_printf(s, "daemonize = %s\n", pa_yes_no(c->daemonize));
pa_strbuf_printf(s, "fail = %s\n", pa_yes_no(c->fail));
commit c0cf22d0812d766fb7528449be1351ca2e030a8c
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 19:26:21 2009 +0200
protocol-esound: don't accept a request of PROTOCOL_MAX
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index e1643cb..840f458 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -924,7 +924,7 @@ static int do_read(connection *c) {
c->request = PA_MAYBE_INT32_SWAP(c->swap_byte_order, c->request);
- if (c->request < ESD_PROTO_CONNECT || c->request > ESD_PROTO_MAX) {
+ if (c->request < ESD_PROTO_CONNECT || c->request >= ESD_PROTO_MAX) {
pa_log("recieved invalid request.");
return -1;
}
commit 0684b236f0ad2fc367971bfa02cb466c2170aafd
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 19:44:55 2009 +0200
stream-resotre: don't leak a name
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 434dc7a..d935caf 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -532,6 +532,7 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
pa_xfree(n);
continue;
}
+ pa_xfree(n);
if (u->restore_volume) {
pa_cvolume v;
@@ -581,6 +582,7 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
pa_xfree(n);
continue;
}
+ pa_xfree(n);
if (u->restore_device &&
e->device_valid &&
commit 88fc458393e00834cec5abe6c26a3cf114398532
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 20:00:57 2009 +0200
protocol-native: don't leak a proplist
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 59fae98..a963f78 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -2560,7 +2560,10 @@ static void command_create_upload_stream(pa_pdispatch *pd, uint32_t command, uin
if (!(name = pa_proplist_gets(p, PA_PROP_EVENT_ID)))
name = pa_proplist_gets(p, PA_PROP_MEDIA_NAME);
- CHECK_VALIDITY(c->pstream, name && pa_namereg_is_valid_name(name), tag, PA_ERR_INVALID);
+ if (!name || !pa_namereg_is_valid_name(name)) {
+ pa_proplist_free(p);
+ CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_INVALID);
+ }
s = upload_stream_new(c, &ss, &map, name, length, p);
pa_proplist_free(p);
@@ -3590,24 +3593,30 @@ static void command_update_proplist(pa_pdispatch *pd, uint32_t command, uint32_t
}
}
- CHECK_VALIDITY(c->pstream, mode == PA_UPDATE_SET || mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE, tag, PA_ERR_INVALID);
+ if (!(mode == PA_UPDATE_SET || mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE)) {
+ pa_proplist_free(p);
+ CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_INVALID);
+ }
if (command == PA_COMMAND_UPDATE_PLAYBACK_STREAM_PROPLIST) {
playback_stream *s;
s = pa_idxset_get_by_index(c->output_streams, idx);
- CHECK_VALIDITY(c->pstream, s, tag, PA_ERR_NOENTITY);
- CHECK_VALIDITY(c->pstream, playback_stream_isinstance(s), tag, PA_ERR_NOENTITY);
-
+ if (!s || !playback_stream_isinstance(s)) {
+ pa_proplist_free(p);
+ CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_NOENTITY);
+ }
pa_sink_input_update_proplist(s->sink_input, mode, p);
} else if (command == PA_COMMAND_UPDATE_RECORD_STREAM_PROPLIST) {
record_stream *s;
- s = pa_idxset_get_by_index(c->record_streams, idx);
- CHECK_VALIDITY(c->pstream, s, tag, PA_ERR_NOENTITY);
-
+ if (!(s = pa_idxset_get_by_index(c->record_streams, idx))) {
+ pa_proplist_free(p);
+ CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_NOENTITY);
+ }
pa_source_output_update_proplist(s->source_output, mode, p);
+
} else {
pa_assert(command == PA_COMMAND_UPDATE_CLIENT_PROPLIST);
@@ -3615,6 +3624,7 @@ static void command_update_proplist(pa_pdispatch *pd, uint32_t command, uint32_t
}
pa_pstream_send_simple_ack(c->pstream, tag);
+ pa_proplist_free(p);
}
static void command_remove_proplist(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
commit 4722fecb993440db4df6a87203aee5eb796c5763
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 20:31:54 2009 +0200
rtp: remove unused variable a
diff --git a/src/modules/rtp/sdp.c b/src/modules/rtp/sdp.c
index 643361f..7c54743 100644
--- a/src/modules/rtp/sdp.c
+++ b/src/modules/rtp/sdp.c
@@ -44,7 +44,7 @@
char *pa_sdp_build(int af, const void *src, const void *dst, const char *name, uint16_t port, uint8_t payload, const pa_sample_spec *ss) {
uint32_t ntp;
char buf_src[64], buf_dst[64], un[64];
- const char *u, *f, *a;
+ const char *u, *f;
pa_assert(src);
pa_assert(dst);
@@ -62,8 +62,8 @@ char *pa_sdp_build(int af, const void *src, const void *dst, const char *name, u
ntp = (uint32_t) time(NULL) + 2208988800U;
- pa_assert_se(a = inet_ntop(af, src, buf_src, sizeof(buf_src)));
- pa_assert_se(a = inet_ntop(af, dst, buf_dst, sizeof(buf_dst)));
+ pa_assert_se(inet_ntop(af, src, buf_src, sizeof(buf_src)));
+ pa_assert_se(inet_ntop(af, dst, buf_dst, sizeof(buf_dst)));
return pa_sprintf_malloc(
PA_SDP_HEADER
commit f1dcbe0f5d363f96d7ad44dcb5bd84d09b54ba3a
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 21:21:25 2009 +0200
pulsecore: don't leak d in case of error
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 432ee3b..623a488 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -1443,6 +1443,7 @@ char *pa_get_runtime_dir(void) {
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
+ pa_xfree(d);
goto fail;
}
commit 800489eea907815427d08659034ad69dbb56b5e6
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 21:23:41 2009 +0200
pulsecore: don't leak p when make_random_dir_and_link()
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 623a488..a184beb 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -1411,6 +1411,7 @@ static int make_random_dir_and_link(mode_t m, const char *k) {
return -1;
}
+ pa_xfree(p);
return 0;
}
commit 7c78c3f6589eeba9e2a4d7f7abbcaaeb6a89d833
Author: Marc-André Lureau <marc-andre.lureau at nokia.com>
Date: Wed Feb 18 21:35:18 2009 +0200
alsa-util: check if mixer_poll_descriptors_count() < 0
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index c53fd10..a0907c4 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -113,7 +113,7 @@ static void io_cb(pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t
static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
struct pa_alsa_fdlist *fdl = userdata;
unsigned num_fds, i;
- int err;
+ int err, n;
struct pollfd *temp;
pa_assert(a);
@@ -122,7 +122,11 @@ static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
a->defer_enable(fdl->defer, 0);
- num_fds = (unsigned) snd_mixer_poll_descriptors_count(fdl->mixer);
+ if ((n = snd_mixer_poll_descriptors_count(fdl->mixer)) < 0) {
+ pa_log("snd_mixer_poll_descriptors_count() failed: %s", snd_strerror(n));
+ return;
+ }
+ num_fds = (unsigned) n;
if (num_fds != fdl->num_fds) {
if (fdl->fds)
commit b0c0106824b47e7b21f022cb0f8dbf5b54a7b269
Merge: 7c78c3f... 05b7440...
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Feb 19 05:02:52 2009 +0100
Merge commit 'elmarco/legacy-dir'
commit 2e250aaebb7708b25b5342d8ced657364adedc95
Merge: b0c0106... 38ded3b...
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Feb 19 05:17:08 2009 +0100
Merge commit '38ded3bb31bc49664641965f856a35f432a8a956'
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list