mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue