diff options
author | Thibaut Mattern <tmattern@users.sourceforge.net> | 2002-06-03 23:12:44 +0000 |
---|---|---|
committer | Thibaut Mattern <tmattern@users.sourceforge.net> | 2002-06-03 23:12:44 +0000 |
commit | 77e59d9aee93a21400b75f36e1eb89f91036c767 (patch) | |
tree | 074bf4a85eb4ce933085d4eeb2b1393ca26e7517 /src/audio_out/audio_alsa_out.c | |
parent | 06a76b6c287a3ebf57669bc964e0b61d19369e58 (diff) | |
download | xine-lib-77e59d9aee93a21400b75f36e1eb89f91036c767.tar.gz xine-lib-77e59d9aee93a21400b75f36e1eb89f91036c767.tar.bz2 |
Flush audio_out buffers at seek and pause.
CVS patchset: 2008
CVS date: 2002/06/03 23:12:44
Diffstat (limited to 'src/audio_out/audio_alsa_out.c')
-rw-r--r-- | src/audio_out/audio_alsa_out.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 86309986c..b77e9dbc8 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -26,7 +26,7 @@ * (c) 2001 James Courtier-Dutton <James@superbug.demon.co.uk> * * - * $Id: audio_alsa_out.c,v 1.54 2002/06/03 09:45:12 f1rmb Exp $ + * $Id: audio_alsa_out.c,v 1.55 2002/06/03 23:12:44 tmattern Exp $ */ #ifdef HAVE_CONFIG_H @@ -640,36 +640,51 @@ static int ao_alsa_set_property (ao_driver_t *this_gen, int property, int value) static int ao_alsa_ctrl(ao_driver_t *this_gen, int cmd, ...) { alsa_driver_t *this = (alsa_driver_t *) this_gen; int result; -#if 0 - /* Alsa 0.9.x pause and result is not stable enough at the moment. - * FIXME: Change these to snd_pcm_drop and restart. + + /* Alsa 0.9.x pause and resume is not stable enough at the moment. + * Use snd_pcm_drop and restart instead. */ switch (cmd) { case AO_CTRL_PLAY_PAUSE: if ((this->has_pause_resume) && (this->audio_fd > 0)) { +#if 0 if ((result=snd_pcm_pause(this->audio_fd, 1)) < 0) { printf("Pause call failed err=%d\n",result); } +#else + if ((result=snd_pcm_drop(this->audio_fd)) < 0) { + printf("Drop call failed err=%d\n",result); + } + if ((result=snd_pcm_prepare(this->audio_fd)) < 0) { + printf("Prepare call failed err=%d\n",result); + } +#endif } break; case AO_CTRL_PLAY_RESUME: if ((this->has_pause_resume) && (this->audio_fd > 0) ) { +#if 0 if ((result=snd_pcm_pause(this->audio_fd, 0)) < 0) { printf("Resume call failed err=%d\n",result); } +#endif } break; case AO_CTRL_FLUSH_BUFFERS: if (this->audio_fd > 0) { - snd_pcm_drop(this->audio_fd); - snd_pcm_prepare(this->audio_fd); + printf("audio_alsa_out: flush buffer\n"); + if ((result=snd_pcm_drop(this->audio_fd)) < 0) { + printf("Drop call failed err=%d\n",result); + } + if ((result=snd_pcm_prepare(this->audio_fd)) < 0) { + printf("Prepare call failed err=%d\n",result); + } } break; } -#endif return 0; } |