changeset 8348:1cf5d8a5bbe8

the -af delay=[seconds] option currently parses floating point values of "seconds" but uses only the integral part of it. This one-line patch fixes that problem. It should be clear enough. Linards Ticmanis <ticmanis@coli.uni-sb.de>
author arpi
date Wed, 04 Dec 2002 21:48:15 +0000
parents 03ee1d7deba5
children 916d5392dcc9
files libaf/af_delay.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af_delay.c	Wed Dec 04 21:46:53 2002 +0000
+++ b/libaf/af_delay.c	Wed Dec 04 21:48:15 2002 +0000
@@ -50,7 +50,8 @@
     // Set new len and allocate new buffer
     s->tlen = *((float*)arg);
     af->delay = s->tlen * 1000.0;
-    s->len  = af->data->rate*af->data->bps*af->data->nch*(int)s->tlen;
+//    s->len  = af->data->rate*af->data->bps*af->data->nch*(int)s->tlen;
+    s->len  = ((int)(af->data->rate*s->tlen))*af->data->bps*af->data->nch;
     s->buf  = malloc(s->len);
     af_msg(AF_MSG_DEBUG0,"[delay] Delaying audio output by %0.2fs\n",s->tlen);
     af_msg(AF_MSG_DEBUG1,"[delay] Delaying audio output by %i bytes\n",s->len);