[MPlayer-dev-eng] mp3

Alban Bedel albeu at free.fr
Sun Feb 17 17:50:10 CET 2002


Hi Bohdan Horst,

on Sun, 17 Feb 2002 17:10:41 +0100 you wrote:

> 
> mplayer.c
> 
> line 1586
> 
> usec_sleep(sh_audio->a_buffer_len/sh_audio->o_bps/1000);
> 
> why it is so small ?
> 
> sh_audio->a_buffer_len/sh_audio->o_bps/1000 is about 1/100000 
> 
> with my tests (FreeBSD)
> sh_audio->a_buffer_len=0-4096, sh_audio->o_bps=176000
> 
> with al3x tests (Linux)
> sh_audio->a_buffer_len=8-2056, sh_audio->_bps=88200
>
Ok lets look at it :
sh_audio->a_buffer_len == buffer length in bytes
sh_audio->o_bps == bytes/sec of the data in the buffer.
So sh_audio->a_buffer_len/sh_audio->o_bps == length of the buffer in sec.
1 usec == 1/1000000 sec so 
sh_audio->a_buffer_len/sh_audio->o_bps*1000000 == length of the buffer in usec.
Sorry for this VERY BIG math mistake, I'll commit this.
	Albeu



More information about the MPlayer-dev-eng mailing list