diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-02-27 23:06:32 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-02-27 23:06:32 +0000 |
commit | 95cf851ea67f41c3c8b2da81c1d6dd55ab47458a (patch) | |
tree | 397d495bb6918e0ee03aa9b0517a67ca524fc606 | |
parent | 4c3d533c7dd64294c77e528e22f88da2b67937a8 (diff) |
aos should respect the immed uninit flag (quit immediatly vs waiting till file
is played to end).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14850 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libao2/ao_alsa.c | 3 | ||||
-rw-r--r-- | libao2/ao_nas.c | 1 | ||||
-rw-r--r-- | libao2/ao_sdl.c | 3 | ||||
-rw-r--r-- | libao2/ao_sgi.c | 1 |
4 files changed, 6 insertions, 2 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 45e95e623a..361590ee30 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -687,6 +687,9 @@ static void uninit(int immed) if (alsa_handler) { int err; + if (!immed) + snd_pcm_drain(alsa_handler); + if (!ao_noblock) { if ((err = snd_pcm_drop(alsa_handler)) < 0) { diff --git a/libao2/ao_nas.c b/libao2/ao_nas.c index c040432f7d..f99573f915 100644 --- a/libao2/ao_nas.c +++ b/libao2/ao_nas.c @@ -482,6 +482,7 @@ static void uninit(int immed){ 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); diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c index b75d6dd27e..d2e506cf55 100644 --- a/libao2/ao_sdl.c +++ b/libao2/ao_sdl.c @@ -293,8 +293,7 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s 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); } diff --git a/libao2/ao_sgi.c b/libao2/ao_sgi.c index 255a054460..e41e77f2b0 100644 --- a/libao2/ao_sgi.c +++ b/libao2/ao_sgi.c @@ -126,6 +126,7 @@ static void uninit(int immed) { 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); |