changeset 4331:ce1e3668fa2b

freq fix, removed muxer delay
author arpi
date Thu, 24 Jan 2002 00:53:22 +0000
parents 41dbef7900d0
children ae889abf93cd
files libao2/ao_mpegpes.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
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;
 }