summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-11-08 13:03:35 +0000
committerPierre Ossman <ossman@cendio.se>2006-11-08 13:03:35 +0000
commit0ef2d7eb778e25d252c78594fa6490a6cb654cb9 (patch)
treebfc44cf43c59fcc73b5eadf13804cb0c3222e370
parent55c25c657e907178de36e5b06b44cae66174d922 (diff)
Support reversed endian floats. (closes #28) (closes #35)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1412 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/pulsecore/sample-util.c1
-rw-r--r--src/pulsecore/sconv.c20
2 files changed, 21 insertions, 0 deletions
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index d902b4b5..a7a5ed8f 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -68,6 +68,7 @@ void pa_silence_memory(void *p, size_t length, const pa_sample_spec *spec) {
case PA_SAMPLE_S16LE:
case PA_SAMPLE_S16BE:
case PA_SAMPLE_FLOAT32:
+ case PA_SAMPLE_FLOAT32RE:
c = 0;
break;
case PA_SAMPLE_ALAW:
diff --git a/src/pulsecore/sconv.c b/src/pulsecore/sconv.c
index ff2a0110..2e5e2dbe 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.c
@@ -72,6 +72,22 @@ static void float32ne_from_float32ne(unsigned n, const float *a, void *b) {
oil_memcpy(b, a, sizeof(float) * n);
}
+static void float32re_to_float32ne(unsigned n, const void *a, float *b) {
+ assert(a);
+ assert(b);
+
+ while (n-- > 0)
+ ((uint32_t *)b)[n] = UINT32_SWAP (((uint32_t *)a)[n]);
+}
+
+static void float32re_from_float32ne(unsigned n, const float *a, void *b) {
+ assert(a);
+ assert(b);
+
+ while (n-- > 0)
+ ((uint32_t *)b)[n] = UINT32_SWAP (((uint32_t *)a)[n]);
+}
+
static void ulaw_to_float32ne(unsigned n, const void *a, float *b) {
const uint8_t *ca = a;
@@ -140,6 +156,8 @@ pa_convert_to_float32ne_func_t pa_get_convert_to_float32ne_function(pa_sample_fo
return pa_sconv_s16be_to_float32ne;
case PA_SAMPLE_FLOAT32NE:
return float32ne_to_float32ne;
+ case PA_SAMPLE_FLOAT32RE:
+ return float32re_to_float32ne;
case PA_SAMPLE_ALAW:
return alaw_to_float32ne;
case PA_SAMPLE_ULAW:
@@ -159,6 +177,8 @@ pa_convert_from_float32ne_func_t pa_get_convert_from_float32ne_function(pa_sampl
return pa_sconv_s16be_from_float32ne;
case PA_SAMPLE_FLOAT32NE:
return float32ne_from_float32ne;
+ case PA_SAMPLE_FLOAT32RE:
+ return float32re_from_float32ne;
case PA_SAMPLE_ALAW:
return alaw_from_float32ne;
case PA_SAMPLE_ULAW: