[Mplayer-cvslog] CVS: main/libao2 ao_alsa1x.c, 1.43, 1.44 ao_alsa5.c, 1.17, 1.18 ao_alsa9.c, 1.45, 1.46 ao_arts.c, 1.5, 1.6 ao_dxr2.c, 1.4, 1.5 ao_esd.c, 1.5, 1.6 ao_macosx.c, 1.2, 1.3 ao_mpegpes.c, 1.18, 1.19 ao_nas.c, 1.14, 1.15 ao_null.c, 1.10, 1.11 ao_oss.c, 1.41, 1.42 ao_pcm.c, 1.19, 1.20 ao_plugin.c, 1.23, 1.24 ao_sdl.c, 1.28, 1.29 ao_sgi.c, 1.4, 1.5 ao_sun.c, 1.25, 1.26 ao_win32.c, 1.7, 1.8 audio_out.h, 1.12, 1.13

Alex Beregszaszi syncmail at mplayerhq.hu
Tue Apr 6 19:55:38 CEST 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv17816/libao2

Modified Files:
	ao_alsa1x.c ao_alsa5.c ao_alsa9.c ao_arts.c ao_dxr2.c ao_esd.c 
	ao_macosx.c ao_mpegpes.c ao_nas.c ao_null.c ao_oss.c ao_pcm.c 
	ao_plugin.c ao_sdl.c ao_sgi.c ao_sun.c ao_win32.c audio_out.h 
Log Message:
uninit immed flag

Index: ao_alsa1x.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa1x.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- ao_alsa1x.c	27 Feb 2004 16:57:06 -0000	1.43
+++ ao_alsa1x.c	6 Apr 2004 17:55:36 -0000	1.44
@@ -736,7 +736,7 @@
 
 
 /* close audio device */
-static void uninit()
+static void uninit(int immed)
 {
 
   if (alsa_handler) {

Index: ao_alsa5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa5.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ao_alsa5.c	24 Dec 2003 22:00:50 -0000	1.17
+++ ao_alsa5.c	6 Apr 2004 17:55:36 -0000	1.18
@@ -236,7 +236,7 @@
 }
 
 /* close audio device */
-static void uninit()
+static void uninit(int immed)
 {
     int err;
 

Index: ao_alsa9.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa9.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- ao_alsa9.c	3 Apr 2004 10:46:52 -0000	1.45
+++ ao_alsa9.c	6 Apr 2004 17:55:36 -0000	1.46
@@ -723,7 +723,7 @@
 
 
 /* close audio device */
-static void uninit()
+static void uninit(int immed)
 {
 
   if (alsa_handler) {

Index: ao_arts.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_arts.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ao_arts.c	21 Mar 2003 16:42:50 -0000	1.5
+++ ao_arts.c	6 Apr 2004 17:55:36 -0000	1.6
@@ -100,7 +100,7 @@
 	return 1;
 }
 
-static void uninit()
+static void uninit(int immed)
 {
 	arts_close_stream(stream);
 	arts_free();

Index: ao_dxr2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_dxr2.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ao_dxr2.c	21 Mar 2003 16:42:50 -0000	1.4
+++ ao_dxr2.c	6 Apr 2004 17:55:36 -0000	1.5
@@ -118,7 +118,7 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
 
 }
 

Index: ao_esd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_esd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ao_esd.c	10 Dec 2003 12:19:13 -0000	1.5
+++ ao_esd.c	6 Apr 2004 17:55:36 -0000	1.6
@@ -274,7 +274,7 @@
 /*
  * close audio device
  */
-static void uninit()
+static void uninit(int immed)
 {
     if (esd_play_fd >= 0) {
 	esd_close(esd_play_fd);

Index: ao_macosx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_macosx.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ao_macosx.c	22 May 2003 16:12:54 -0000	1.2
+++ ao_macosx.c	6 Apr 2004 17:55:36 -0000	1.3
@@ -353,7 +353,7 @@
 
 
 /* unload plugin and deregister from coreaudio */
-static void uninit()
+static void uninit(int immed)
 {
   int i;
   OSErr status;

Index: ao_mpegpes.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_mpegpes.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ao_mpegpes.c	21 Mar 2003 16:42:50 -0000	1.18
+++ ao_mpegpes.c	6 Apr 2004 17:55:36 -0000	1.19
@@ -131,7 +131,7 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
 
 }
 

Index: ao_nas.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_nas.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ao_nas.c	13 Mar 2004 21:54:35 -0000	1.14
+++ ao_nas.c	6 Apr 2004 17:55:36 -0000	1.15
@@ -476,7 +476,7 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
 
 	mp_msg(MSGT_AO, MSGL_DBG3, "ao_nas: uninit()\n");
 

Index: ao_null.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_null.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ao_null.c	21 Mar 2003 16:42:50 -0000	1.10
+++ ao_null.c	6 Apr 2004 17:55:36 -0000	1.11
@@ -64,7 +64,7 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
 
 }
 

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- ao_oss.c	24 Jan 2004 11:53:52 -0000	1.41
+++ ao_oss.c	6 Apr 2004 17:55:36 -0000	1.42
@@ -263,10 +263,16 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
     if(audio_fd == -1) return;
+#ifdef SNDCTL_DSP_SYNC
+    // to get the buffer played
+    if (!immed)
+	ioctl(audio_fd, SNDCTL_DSP_SYNC, NULL);
+#endif
 #ifdef SNDCTL_DSP_RESET
-    ioctl(audio_fd, SNDCTL_DSP_RESET, NULL);
+    if (immed)
+	ioctl(audio_fd, SNDCTL_DSP_RESET, NULL);
 #endif
     close(audio_fd);
     audio_fd = -1;
@@ -274,7 +280,7 @@
 
 // stop playing and empty buffers (for seeking/pause)
 static void reset(){
-    uninit();
+    uninit(1);
     audio_fd=open(dsp, O_WRONLY);
     if(audio_fd < 0){
 	mp_msg(MSGT_AO,MSGL_ERR,"\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n", strerror(errno));
@@ -300,7 +306,7 @@
 // stop playing, keep buffers (for pause)
 static void audio_pause()
 {
-    uninit();
+    uninit(1);
 }
 
 // resume playing, after audio_pause()

Index: ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ao_pcm.c	26 Oct 2003 13:43:30 -0000	1.19
+++ ao_pcm.c	6 Apr 2004 17:55:36 -0000	1.20
@@ -132,7 +132,7 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
 	
 	if(ao_pcm_waveheader && fseek(fp, 0, SEEK_SET) == 0){ /* Write wave header */
 		wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;

Index: ao_plugin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_plugin.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ao_plugin.c	21 Mar 2003 16:42:50 -0000	1.23
+++ ao_plugin.c	6 Apr 2004 17:55:36 -0000	1.24
@@ -197,9 +197,9 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
   int i=0;
-  driver()->uninit();
+  driver()->uninit(immed);
   while(plugin(i))
     plugin(i++)->uninit();
   if(ao_plugin_local_data.plugins)

Index: ao_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sdl.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- ao_sdl.c	3 Apr 2004 14:39:16 -0000	1.28
+++ ao_sdl.c	6 Apr 2004 17:55:36 -0000	1.29
@@ -265,7 +265,7 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
 	mp_msg(MSGT_AO,MSGL_V,"SDL: Audio Subsystem shutting down!\n");
 	while(buffered_bytes > 0)
 		usec_sleep(50000);

Index: ao_sgi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sgi.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ao_sgi.c	30 Oct 2003 00:08:06 -0000	1.4
+++ ao_sgi.c	6 Apr 2004 17:55:36 -0000	1.5
@@ -118,7 +118,7 @@
 }
 
 // close audio device
-static void uninit() {
+static void uninit(int immed) {
 
   /* TODO: samplerate should be set back to the value before mplayer was started! */
 

Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ao_sun.c	22 Jun 2003 21:29:15 -0000	1.25
+++ ao_sun.c	6 Apr 2004 17:55:36 -0000	1.26
@@ -615,10 +615,11 @@
 }
 
 // close audio device
-static void uninit(){
+static void uninit(int immed){
 #ifdef	__svr4__
     // throw away buffered data in the audio driver's STREAMS queue
-    ioctl(audio_fd, I_FLUSH, FLUSHW);
+    if (immed)
+	ioctl(audio_fd, I_FLUSH, FLUSHW);
 #endif
     close(audio_fd);
 }

Index: ao_win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_win32.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ao_win32.c	1 Apr 2004 19:33:58 -0000	1.7
+++ ao_win32.c	6 Apr 2004 17:55:36 -0000	1.8
@@ -167,7 +167,7 @@
 }
 
 // close audio device
-static void uninit()
+static void uninit(int immed)
 {
     while (buffered_bytes > 0)
 	usec_sleep(50000);

Index: audio_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_out.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- audio_out.h	21 Mar 2003 16:42:50 -0000	1.12
+++ audio_out.h	6 Apr 2004 17:55:36 -0000	1.13
@@ -20,7 +20,7 @@
 	ao_info_t *info;
         int (*control)(int cmd,void *arg);
         int (*init)(int rate,int channels,int format,int flags);
-        void (*uninit)();
+        void (*uninit)(int immed);
         void (*reset)();
         int (*get_space)();
         int (*play)(void* data,int len,int flags);




More information about the MPlayer-cvslog mailing list