# HG changeset patch # User diego # Date 1067472486 0 # Node ID c6758363a2386d3b708696b8d4ac1b41e23d9407 # Parent 39001756cafded6a746805c34633ec2aa0623f17 A-V sync fix by Timo Kanera . diff -r 39001756cafd -r c6758363a238 libao2/ao_sgi.c --- 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); }