changeset 14849:d313f591d1a4

aos should respect the immed uninit flag (quit immediatly vs waiting till file is played to end).
author reimar
date Sun, 27 Feb 2005 23:06:32 +0000
parents f92a93cfc508
children ba555409718b
files libao2/ao_alsa.c libao2/ao_nas.c libao2/ao_sdl.c libao2/ao_sgi.c
diffstat 4 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_alsa.c	Sun Feb 27 22:36:04 2005 +0000
+++ b/libao2/ao_alsa.c	Sun Feb 27 23:06:32 2005 +0000
@@ -687,6 +687,9 @@
   if (alsa_handler) {
     int err;
 
+    if (!immed)
+      snd_pcm_drain(alsa_handler);
+
     if (!ao_noblock) {
       if ((err = snd_pcm_drop(alsa_handler)) < 0)
 	{
--- a/libao2/ao_nas.c	Sun Feb 27 22:36:04 2005 +0000
+++ b/libao2/ao_nas.c	Sun Feb 27 23:06:32 2005 +0000
@@ -482,6 +482,7 @@
 	mp_msg(MSGT_AO, MSGL_DBG3, "ao_nas: uninit()\n");
 
 	nas_data->expect_underrun = 1;
+	if (!immed)
 	while (nas_data->state != AuStateStop) usleep(1000);
 	nas_data->stop_thread = 1;
 	pthread_join(nas_data->event_thread, NULL);
--- a/libao2/ao_sdl.c	Sun Feb 27 22:36:04 2005 +0000
+++ b/libao2/ao_sdl.c	Sun Feb 27 23:06:32 2005 +0000
@@ -293,8 +293,7 @@
 static void uninit(int immed){
 	mp_msg(MSGT_AO,MSGL_V,"SDL: Audio Subsystem shutting down!\n");
 	if (!immed)
-	while(buf_free() < BUFFSIZE - CHUNK_SIZE)
-		usec_sleep(50000);
+	  usec_sleep(get_delay() * 1000 * 1000);
 	SDL_CloseAudio();
 	SDL_QuitSubSystem(SDL_INIT_AUDIO);
 }
--- a/libao2/ao_sgi.c	Sun Feb 27 22:36:04 2005 +0000
+++ b/libao2/ao_sgi.c	Sun Feb 27 23:06:32 2005 +0000
@@ -126,6 +126,7 @@
   mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_Uninit);
 
   if (ao_port) {
+    if (!immed)
     while(alGetFilled(ao_port) > 0) sginap(1);  
     alClosePort(ao_port);
     alFreeConfig(ao_config);