diff options
author | 2009-08-29 23:11:59 +0200 | |
---|---|---|
committer | 2009-08-29 23:11:59 +0200 | |
commit | 44170fb9a816d5108471a3f3eb6aa92609e7a253 (patch) | |
tree | 22c93871083e65bd07d82de309ae01b750066b72 /streamer.c | |
parent | 2b088104790e6f752e1c342d6c4caf7dc23755fd (diff) |
slight optimization of float_to_int casts in streamer
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |