summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--src/daemon/daemon-conf.c2
-rw-r--r--src/daemon/main.c4
-rw-r--r--src/modules/alsa/alsa-util.c12
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c25
-rw-r--r--src/modules/bluetooth/sbc.c18
-rw-r--r--src/modules/bluetooth/sbc.h1
-rw-r--r--src/modules/bluetooth/sbc_primitives.c1
-rw-r--r--src/modules/bluetooth/sbc_primitives.h1
-rw-r--r--src/modules/bluetooth/sbc_primitives_mmx.c1
-rw-r--r--src/modules/bluetooth/sbc_primitives_neon.c1
-rw-r--r--src/modules/dbus-util.c3
-rw-r--r--src/modules/module-card-restore.c2
-rw-r--r--src/modules/module-hal-detect.c1
-rw-r--r--src/modules/module-stream-restore.c2
-rw-r--r--src/modules/rtp/module-rtp-recv.c2
-rw-r--r--src/modules/rtp/sdp.c6
-rw-r--r--src/pulse/context.c6
-rw-r--r--src/pulsecore/cli-command.c3
-rw-r--r--src/pulsecore/core-util.c4
-rw-r--r--src/pulsecore/hashmap.c2
-rw-r--r--src/pulsecore/log.c1
-rw-r--r--src/pulsecore/protocol-esound.c2
-rw-r--r--src/pulsecore/protocol-native.c30
-rw-r--r--src/tests/interpol-test.c3
-rw-r--r--src/tests/ipacl-test.c3
-rw-r--r--src/tests/sync-playback.c7
-rw-r--r--src/tests/thread-mainloop-test.c2
-rw-r--r--src/utils/pacat.c3
-rw-r--r--src/utils/pactl.c6
-rw-r--r--src/utils/padsp.c4
-rw-r--r--src/utils/paplay.c5
32 files changed, 115 insertions, 54 deletions
diff --git a/configure.ac b/configure.ac
index ddf7a1cc..11b091bb 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/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 7d3b89f0..7dfef27f 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));
diff --git a/src/daemon/main.c b/src/daemon/main.c
index d3e02fa0..5f94ec66 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);
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 8607e469..d00a80f1 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@cendio.se> for Cendio AB
PulseAudio is free software; you can redistribute it and/or modify
@@ -114,7 +114,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);
@@ -123,7 +123,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)
@@ -1405,7 +1409,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);
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 27f9e7c2..ac8344f0 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -906,6 +906,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) {
@@ -1351,9 +1356,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; */
@@ -1398,9 +1400,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; */
@@ -1525,9 +1524,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;
}
@@ -1561,11 +1560,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;
}
diff --git a/src/modules/bluetooth/sbc.c b/src/modules/bluetooth/sbc.c
index 29258d05..a33ed571 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 b0a14888..f9d506bc 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 303f3fee..6b0be3f5 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 2708c829..3d01c115 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 1870a9ba..08e9ca28 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 d9c12f9e..f1bc7b48 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
diff --git a/src/modules/dbus-util.c b/src/modules/dbus-util.c
index f6a986a5..4218bca5 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)
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 909c0957..c7696058 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);
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index e6037381..ce04f367 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))
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 434dc7a0..d935caf6 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 &&
diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
index 063ba725..0d86459e 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 {
diff --git a/src/modules/rtp/sdp.c b/src/modules/rtp/sdp.c
index 643361f2..7c547430 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
diff --git a/src/pulse/context.c b/src/pulse/context.c
index d8d0a51d..9309c6b7 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -554,6 +554,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;
@@ -597,10 +598,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 */
@@ -618,6 +621,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))) {
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 1df0bd63..5e45c1aa 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;
}
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 61f9a656..a184bebd 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;
}
@@ -1443,6 +1444,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;
}
@@ -2459,7 +2461,7 @@ char *pa_machine_id(void) {
pa_strip_nl(ln);
- if (ln[0])
+ if (r && ln[0])
return pa_xstrdup(ln);
}
diff --git a/src/pulsecore/hashmap.c b/src/pulsecore/hashmap.c
index 3c6f41ec..57607b69 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))))
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index 1ae43839..89b75da3 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(
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index e1643cbb..840f4581 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;
}
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 79b9b069..a963f78a 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);
@@ -3011,7 +3014,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);
@@ -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) {
@@ -4070,7 +4080,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);
diff --git a/src/tests/interpol-test.c b/src/tests/interpol-test.c
index 20d2c230..d7da660c 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;
diff --git a/src/tests/ipacl-test.c b/src/tests/ipacl-test.c
index 7b7564a4..f89665cd 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);
diff --git a/src/tests/sync-playback.c b/src/tests/sync-playback.c
index 42c479a1..f2a15601 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++)
diff --git a/src/tests/thread-mainloop-test.c b/src/tests/thread-mainloop-test.c
index 263cd57d..3bcf4f16 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);
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 10015ce4..2224da9a 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)
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 154e7f9c..d3da90e6 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);
@@ -1029,7 +1030,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"));
diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index 046bae45..76e86c8d 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;
diff --git a/src/utils/paplay.c b/src/utils/paplay.c
index df2edf62..dec80e5c 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) {