[pulseaudio-commits] r2345 - /branches/glitch-free/src/pulsecore/sample-util.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Thu May 1 18:24:47 PDT 2008
Author: lennart
Date: Fri May 2 03:24:47 2008
New Revision: 2345
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2345&root=pulseaudio&view=rev
Log:
reorderer a few things
Modified:
branches/glitch-free/src/pulsecore/sample-util.c
Modified: branches/glitch-free/src/pulsecore/sample-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/sample-util.c?rev=2345&root=pulseaudio&r1=2344&r2=2345&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/sample-util.c (original)
+++ branches/glitch-free/src/pulsecore/sample-util.c Fri May 2 03:24:47 2008
@@ -1002,20 +1002,19 @@
}
void pa_sample_clamp(pa_sample_format_t format, void *dst, size_t dstr, const void *src, size_t sstr, unsigned n) {
-
const float *s;
float *d;
- if (format != PA_SAMPLE_FLOAT32BE && format != PA_SAMPLE_FLOAT32LE)
- return;
-
- s = src;
- d = dst;
+ s = src; d = dst;
if (format == PA_SAMPLE_FLOAT32NE) {
- const static float minus_one = -1.0, plus_one = 1.0;
- oil_clip_f32(dst, dstr, src, sstr, n, &minus_one, &plus_one);
- } else
+
+ float minus_one = -1.0, plus_one = 1.0;
+ oil_clip_f32(d, dstr, s, sstr, n, &minus_one, &plus_one);
+
+ } else {
+ pa_assert(format == PA_SAMPLE_FLOAT32RE);
+
for (; n > 0; n--) {
float f;
@@ -1026,4 +1025,5 @@
s = (const float*) ((const uint8_t*) s + sstr);
d = (float*) ((uint8_t*) d + dstr);
}
-}
+ }
+}
More information about the pulseaudio-commits
mailing list