mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio
This commit is contained in:
commit
7bc1847596
32 changed files with 115 additions and 54 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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))))
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ void pa_log_levelv_meta(
|
|||
}
|
||||
|
||||
errno = saved_errno;
|
||||
pa_xfree(bt);
|
||||
}
|
||||
|
||||
void pa_log_level_meta(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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"));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue