From 630f58aa8a9e43d4781d8f9ffe291b7e2d04b42f Mon Sep 17 00:00:00 2001 From: arpi Date: Wed, 4 Dec 2002 21:48:15 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8349 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_delay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libaf/af_delay.c b/libaf/af_delay.c index f19dc1934b..6ee94c2427 100644 --- a/libaf/af_delay.c +++ b/libaf/af_delay.c @@ -50,7 +50,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg) // 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);