From 1bdfaf59105775beb47f3861cd84c0ac83d30ba8 Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Thu, 13 Jun 2002 18:39:17 +0000 Subject: Try to use snd_pcm_pause, fallback to a reset if it doesn't work. CVS patchset: 2072 CVS date: 2002/06/13 18:39:17 --- src/audio_out/audio_alsa_out.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 42b85cb29..e71c3c010 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 * * - * $Id: audio_alsa_out.c,v 1.56 2002/06/12 12:22:26 f1rmb Exp $ + * $Id: audio_alsa_out.c,v 1.57 2002/06/13 18:39:17 tmattern Exp $ */ #ifdef HAVE_CONFIG_H @@ -647,28 +647,20 @@ static int ao_alsa_ctrl(ao_driver_t *this_gen, int 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); + printf("audio_alsa_out: Pause call failed, try drop/prepare instead\n"); + ao_alsa_ctrl(this_gen, AO_CTRL_FLUSH_BUFFERS); } -#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 + } else { + ao_alsa_ctrl(this_gen, AO_CTRL_FLUSH_BUFFERS); } 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; -- cgit v1.2.3