[polypaudio-commits] r714 - /trunk/src/polypcore/resampler.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sat Apr 15 08:25:54 PDT 2006
Author: lennart
Date: Sat Apr 15 17:25:53 2006
New Revision: 714
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=714&root=polypaudio&view=rev
Log:
correct some types
Modified:
trunk/src/polypcore/resampler.c
Modified: trunk/src/polypcore/resampler.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/resampler.c?rev=714&root=polypaudio&r1=713&r2=714&view=diff
==============================================================================
--- trunk/src/polypcore/resampler.c (original)
+++ trunk/src/polypcore/resampler.c Sat Apr 15 17:25:53 2006
@@ -262,7 +262,7 @@
}
}
-static float * convert_to_float(pa_resampler *r, float *input, unsigned n_frames) {
+static float * convert_to_float(pa_resampler *r, void *input, unsigned n_frames) {
struct impl_libsamplerate *u;
unsigned n_samples;
@@ -369,7 +369,7 @@
return u->buf3;
}
-static float *convert_from_float(pa_resampler *r, float *input, unsigned n_frames) {
+static void *convert_from_float(pa_resampler *r, float *input, unsigned n_frames) {
struct impl_libsamplerate *u;
unsigned n_samples;
@@ -395,7 +395,8 @@
static void libsamplerate_run(pa_resampler *r, const pa_memchunk *in, pa_memchunk *out) {
struct impl_libsamplerate *u;
- float *buf, *input;
+ float *buf;
+ void *input, *output;
unsigned n_frames;
assert(r);
@@ -408,18 +409,18 @@
u = r->impl_data;
- buf = input = (float*) ((uint8_t*) in->memblock->data + in->index);
+ input = ((uint8_t*) in->memblock->data + in->index);
n_frames = in->length / r->i_fz;
assert(n_frames > 0);
- buf = convert_to_float(r, buf, n_frames);
+ buf = convert_to_float(r, input, n_frames);
buf = remap_channels(r, buf, n_frames);
buf = resample(r, buf, &n_frames);
if (n_frames) {
- buf = convert_from_float(r, buf, n_frames);
-
- if (buf == input) {
+ output = convert_from_float(r, buf, n_frames);
+
+ if (output == input) {
/* Mm, no adjustment has been necessary, so let's return the original block */
out->memblock = pa_memblock_ref(in->memblock);
out->index = in->index;
@@ -430,16 +431,16 @@
out->length = n_frames * r->o_fz;
out->index = 0;
- if (buf == u->buf1) {
+ if (output == u->buf1) {
p = &u->buf1;
u->buf1_samples = 0;
- } else if (buf == u->buf2) {
+ } else if (output == u->buf2) {
p = &u->buf2;
u->buf2_samples = 0;
- } else if (buf == u->buf3) {
+ } else if (output == u->buf3) {
p = &u->buf3;
u->buf3_samples = 0;
- } else if (buf == u->buf4) {
+ } else if (output == u->buf4) {
p = &u->buf4;
u->buf4_samples = 0;
}
More information about the pulseaudio-commits
mailing list