[Mplayer-cvslog] CVS: main/libao2 ao_sun.c,1.21,1.22

Jürgen Keil jkeil at mplayerhq.hu
Fri Oct 11 23:23:14 CEST 2002


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv32093

Modified Files:
	ao_sun.c 
Log Message:
- ao_data.bps not set, confuses the A-V sync computation when the audio filters
are in use.

- computation in get_delay() was returning bogus values


Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ao_sun.c	7 Oct 2002 18:42:31 -0000	1.21
+++ ao_sun.c	11 Oct 2002 21:22:55 -0000	1.22
@@ -463,6 +463,20 @@
 	enable_sample_timing = realtime_samplecounter_available(audio_dev);
     }
 
+#define	AF_FILTER_TEST 0
+#if	AF_FILTER_TEST
+    /* test code to force use of the audio filter modules */
+    {
+	char *s;
+	if (s = getenv("AF_RATE"))
+	    rate = atoi(s);
+	if (s = getenv("AF_CHANNELS"))
+	    channels = atoi(s);
+	if (s = getenv("AF_BITS"))
+	    format = atoi(s) == 16 ? AFMT_S16_NE : AFMT_U8;
+    }
+#endif
+
 //    printf("ao2: %d Hz  %d chans  %s [0x%X]\n",
 //	   rate,channels,audio_out_format_name(format),format);
 
@@ -548,7 +562,7 @@
     }
 
     bytes_per_sample = channels * info.play.precision / 8;
-    byte_per_sec = bytes_per_sample * rate;
+    ao_data.bps = byte_per_sec = bytes_per_sample * rate;
     ao_data.outburst = byte_per_sec > 100000 ? 16384 : 8192;
 
 #ifdef	__not_used__
@@ -746,7 +760,7 @@
     return (float) info.play.seek/ (float)byte_per_sec ;
 #else
     if (info.play.samples && enable_sample_timing == RTSC_ENABLED)
-	return (float)(queued_samples - info.play.samples) / (float)byte_per_sec;
+	return (float)(queued_samples - info.play.samples) / (float)ao_data.samplerate;
     else
 	return (float)((queued_bursts - info.play.eof) * ao_data.outburst) / (float)byte_per_sec;
 #endif




More information about the MPlayer-cvslog mailing list