changeset 11323:c6758363a238

A-V sync fix by Timo Kanera <timo@kanera.de>.
author diego
date Thu, 30 Oct 2003 00:08:06 +0000
parents 39001756cafd
children 9fceaedbd5a6
files libao2/ao_sgi.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_sgi.c	Wed Oct 29 22:51:09 2003 +0000
+++ b/libao2/ao_sgi.c	Thu Oct 30 00:08:06 2003 +0000
@@ -25,6 +25,8 @@
 
 static ALconfig	ao_config;
 static ALport	ao_port;
+static int sample_rate;
+static int queue_size;
 
 // to set/get/query special features/parameters
 static int control(int cmd, void *arg){
@@ -54,7 +56,7 @@
     }
     
     frate = rate;
-
+   
     x[0].param = AL_RATE;
     x[0].value.ll = alDoubleToFixed(rate);
     x[1].param = AL_MASTER_CLOCK;
@@ -76,7 +78,7 @@
     if (frate != alFixedToDouble(x[0].value.ll)) {
       printf("ao_sgi, init: samplerate is now %lf (desired rate is %lf)\n", alFixedToDouble(x[0].value.ll), frate);
     } 
-
+    sample_rate = (int)frate;
   }
   
   ao_data.buffersize=131072;
@@ -110,7 +112,7 @@
   }
   
   // printf("ao_sgi, init: port %d config %d\n", ao_port, ao_config);
-  
+  queue_size = alGetQueueSize(ao_config);
   return 1;  
 
 }
@@ -181,8 +183,8 @@
   
   // printf("ao_sgi, get_delay: (ao_buffersize %d)\n", ao_buffersize);
   
-  return 0;
-
+  //return 0;
+  return  (float)queue_size/((float)sample_rate);
 }