# HG changeset patch # User arpi # Date 1011833602 0 # Node ID ce1e3668fa2ba9bbcc4ca18c0add92017be6ea4f # Parent 41dbef7900d0ec2cb673894ace490b449fbf457e freq fix, removed muxer delay diff -r 41dbef7900d0 -r ce1e3668fa2b libao2/ao_mpegpes.c --- a/libao2/ao_mpegpes.c Thu Jan 24 00:08:22 2002 +0000 +++ b/libao2/ao_mpegpes.c Thu Jan 24 00:53:22 2002 +0000 @@ -22,7 +22,7 @@ return -1; } - +static int freq=0; static int freq_id=0; // open & setup audio device @@ -31,6 +31,7 @@ ao_data.outburst=2000; ao_data.format=format; +freq=rate; switch(rate){ case 48000: freq_id=0;break; @@ -73,11 +74,11 @@ // 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; }