From 6cf2fc4f1966f355a95fb726516cbc6e749d3184 Mon Sep 17 00:00:00 2001 From: arpi Date: Thu, 24 Jan 2002 00:53:22 +0000 Subject: freq fix, removed muxer delay git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4332 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_mpegpes.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libao2') diff --git a/libao2/ao_mpegpes.c b/libao2/ao_mpegpes.c index c5a0d944f4..891a398b52 100644 --- a/libao2/ao_mpegpes.c +++ b/libao2/ao_mpegpes.c @@ -22,7 +22,7 @@ static int control(int cmd,int arg){ return -1; } - +static int freq=0; static int freq_id=0; // open & setup audio device @@ -31,6 +31,7 @@ static int init(int rate,int channels,int format,int flags){ ao_data.outburst=2000; ao_data.format=format; +freq=rate; switch(rate){ case 48000: freq_id=0;break; @@ -73,11 +74,11 @@ extern int vo_pts; // return: how many bytes can be played without blocking static int get_space(){ - float x=(float)(vo_pts-ao_data.pts)/90000.0-0.5; + float x=(float)(vo_pts-ao_data.pts)/90000.0; int y; if(x<=0) return 0; - y=48000*4*x;y/=ao_data.outburst;y*=ao_data.outburst; -// if(y>2000) y=2000; + y=freq*4*x;y/=ao_data.outburst;y*=ao_data.outburst; + if(y>32000) y=32000; // printf("diff: %5.3f -> %d \n",x,y); return y; } -- cgit v1.2.3