[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.11-219-g17436b2
Lennart Poettering
gitmailer-noreply at 0pointer.de
Mon Sep 8 16:18:35 PDT 2008
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 3a46bbeba509ed68dfaf28d94be3efac88a2613b (commit)
- Log -----------------------------------------------------------------
17436b2... make sure peaks resampler also works for very short input buffers
0deb6a4... minor improvements in debug handling
4050447... unbreak pa_idxset_rrobin
-----------------------------------------------------------------------
Summary of changes:
src/modules/module-alsa-sink.c | 8 +++++---
src/modules/module-alsa-source.c | 8 +++++---
src/pulsecore/idxset.c | 3 +--
src/pulsecore/resampler.c | 31 ++++++++++++++++++++-----------
4 files changed, 31 insertions(+), 19 deletions(-)
-----------------------------------------------------------------------
commit 4050447230040983fdc07f665cf4ec3f23dde217
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Sep 9 02:14:27 2008 +0300
unbreak pa_idxset_rrobin
diff --git a/src/pulsecore/idxset.c b/src/pulsecore/idxset.c
index b6423ef..2de6406 100644
--- a/src/pulsecore/idxset.c
+++ b/src/pulsecore/idxset.c
@@ -318,8 +318,7 @@ void* pa_idxset_rrobin(pa_idxset *s, uint32_t *idx) {
hash = *idx % NBUCKETS;
- if (!(e = index_scan(s, hash, *idx)))
- return NULL;
+ e = index_scan(s, hash, *idx);
if (e && e->iterate_next)
e = e->iterate_next;
commit 0deb6a4b13efd852de6c9ce08e587149368c3b0e
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Sep 9 02:17:01 2008 +0300
minor improvements in debug handling
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index 24ae723..b8bef93 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -654,7 +654,9 @@ static int unsuspend(struct userdata *u) {
}
if (nfrags != u->nfragments || period_size*u->frame_size != u->fragment_size) {
- pa_log_warn("Resume failed, couldn't restore original fragment settings.");
+ pa_log_warn("Resume failed, couldn't restore original fragment settings. (Old: %lu*%lu, New %lu*%lu)",
+ (unsigned long) u->nfragments, (unsigned long) u->fragment_size,
+ (unsigned long) nfrags, period_size * u->frame_size);
goto fail;
}
@@ -1154,7 +1156,7 @@ static void thread_func(void *userdata) {
goto fail;
}
- if (revents & (POLLERR|POLLNVAL|POLLHUP)) {
+ if (revents & (POLLERR|POLLNVAL|POLLHUP|POLLPRI)) {
if (pa_alsa_recover_from_poll(u->pcm_handle, revents) < 0)
goto fail;
@@ -1163,7 +1165,7 @@ static void thread_func(void *userdata) {
}
if (revents && u->use_tsched)
- pa_log_debug("Wakeup from ALSA! (%i)", revents);
+ pa_log_debug("Wakeup from ALSA!%s%s", (revents & POLLIN) ? " INPUT" : "", (revents & POLLOUT) ? " OUTPUT" : "");
}
}
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index 86e08f7..cb77767 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -597,7 +597,9 @@ static int unsuspend(struct userdata *u) {
}
if (nfrags != u->nfragments || period_size*u->frame_size != u->fragment_size) {
- pa_log_warn("Resume failed, couldn't restore original fragment settings.");
+ pa_log_warn("Resume failed, couldn't restore original fragment settings. (Old: %lu*%lu, New %lu*%lu)",
+ (unsigned long) u->nfragments, (unsigned long) u->fragment_size,
+ (unsigned long) nfrags, period_size * u->frame_size);
goto fail;
}
@@ -989,7 +991,7 @@ static void thread_func(void *userdata) {
goto fail;
}
- if (revents & (POLLERR|POLLNVAL|POLLHUP)) {
+ if (revents & (POLLERR|POLLNVAL|POLLHUP|POLLPRI)) {
if (pa_alsa_recover_from_poll(u->pcm_handle, revents) < 0)
goto fail;
@@ -997,7 +999,7 @@ static void thread_func(void *userdata) {
}
if (revents && u->use_tsched)
- pa_log_debug("Wakeup from ALSA! (%i)", revents);
+ pa_log_debug("Wakeup from ALSA!%s%s", (revents & POLLIN) ? " INPUT" : "", (revents & POLLOUT) ? " OUTPUT" : "");
}
}
commit 17436b21d3960386cb0fa81d7438ed7f3eface2d
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Sep 9 02:18:21 2008 +0300
make sure peaks resampler also works for very short input buffers
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 0ae029b..b2d512c 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -1418,40 +1418,46 @@ static void peaks_resample(pa_resampler *r, const pa_memchunk *input, unsigned i
unsigned j;
j = ((r->peaks.o_counter * r->i_ss.rate) / r->o_ss.rate);
- j = j > r->peaks.i_counter ? j - r->peaks.i_counter : 0;
- if (j >= in_n_frames)
- break;
+ if (j > r->peaks.i_counter)
+ j -= r->peaks.i_counter;
+ else
+ j = 0;
pa_assert(o_index * fz < pa_memblock_get_length(output->memblock));
if (r->work_format == PA_SAMPLE_S16NE) {
unsigned i, c;
- int16_t *s = (int16_t*) ((uint8_t*) src + fz * j);
+ int16_t *s = (int16_t*) ((uint8_t*) src + fz * start);
int16_t *d = (int16_t*) ((uint8_t*) dst + fz * o_index);
- for (i = start; i <= j; i++)
+ for (i = start; i <= j && i < in_n_frames; i++)
+
for (c = 0; c < r->o_ss.channels; c++, s++) {
int16_t n;
n = (int16_t) (*s < 0 ? -*s : *s);
- if (n > r->peaks.max_i[c])
+ if (PA_UNLIKELY(n > r->peaks.max_i[c]))
r->peaks.max_i[c] = n;
}
+ if (i >= in_n_frames)
+ break;
+
for (c = 0; c < r->o_ss.channels; c++, d++) {
- *d = r->peaks.max_i[c];
- r->peaks.max_i[c] = 0;
+ *d = r->peaks.max_i[c];
+ r->peaks.max_i[c] = 0;
}
+
} else {
unsigned i, c;
- float *s = (float*) ((uint8_t*) src + fz * j);
+ float *s = (float*) ((uint8_t*) src + fz * start);
float *d = (float*) ((uint8_t*) dst + fz * o_index);
pa_assert(r->work_format == PA_SAMPLE_FLOAT32NE);
- for (i = start; i <= j; i++)
+ for (i = start; i <= j && i < in_n_frames; i++)
for (c = 0; c < r->o_ss.channels; c++, s++) {
float n = fabsf(*s);
@@ -1459,13 +1465,16 @@ static void peaks_resample(pa_resampler *r, const pa_memchunk *input, unsigned i
r->peaks.max_f[c] = n;
}
+ if (i >= in_n_frames)
+ break;
+
for (c = 0; c < r->o_ss.channels; c++, d++) {
*d = r->peaks.max_f[c];
r->peaks.max_f[c] = 0;
}
}
- start = j+1;
+ start = j;
}
pa_memblock_release(input->memblock);
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list