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>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8349 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-12-04 21:48:15 +00:00
parent 3d0a234b62
commit 630f58aa8a
1 changed files with 2 additions and 1 deletions

View File

@ -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);