summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/sconv.c')
-rw-r--r--src/pulsecore/sconv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulsecore/sconv.c b/src/pulsecore/sconv.c
index 733a46ae..6c4d420e 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.c
@@ -130,7 +130,7 @@ static void ulaw_from_float32ne(unsigned n, const float *a, uint8_t *b) {
float v = *(a++);
v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
v *= 0x1FFF;
- *(b++) = st_14linear2ulaw((int16_t) v);
+ *(b++) = st_14linear2ulaw((int16_t) lrintf(v));
}
}
@@ -168,7 +168,7 @@ static void alaw_from_float32ne(unsigned n, const float *a, uint8_t *b) {
float v = *a;
v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
v *= 0xFFF;
- *b = st_13linear2alaw((int16_t) v);
+ *b = st_13linear2alaw((int16_t) lrintf(v));
}
}