summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-29 23:11:59 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-29 23:11:59 +0200
commit44170fb9a816d5108471a3f3eb6aa92609e7a253 (patch)
tree22c93871083e65bd07d82de309ae01b750066b72 /streamer.c
parent2b088104790e6f752e1c342d6c4caf7dc23755fd (diff)
slight optimization of float_to_int casts in streamer
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/streamer.c b/streamer.c
index 91ae3cda..fd60922f 100644
--- a/streamer.c
+++ b/streamer.c
@@ -32,6 +32,7 @@
#include "messages.h"
#include "conf.h"
#include "plugins.h"
+#include "optmath.h"
static int streamer_tid;
static SRC_STATE *src;
@@ -320,7 +321,7 @@ streamer_read_async (char *bytes, int size) {
if (sample < -1) {
sample = -1;
}
- ((int16_t*)bytes)[i] = (int16_t)(sample*32767.f);
+ ((int16_t*)bytes)[i] = (int16_t)ftoi (sample*32767.f);
}
// calculate how many unused input samples left
codecleft = nsamples - srcdata.input_frames_used;