diff libao2/ao_mpegpes.c @ 4331:ce1e3668fa2b

freq fix, removed muxer delay
author arpi
date Thu, 24 Jan 2002 00:53:22 +0000
parents 624c73ec1c54
children d678ce495a75
line wrap: on
line diff
--- 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;
 }