From 15de8717ff36fd310220586ccf3edc66797214d1 Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Sat, 15 Jun 2002 10:24:48 +0000 Subject: Try pause call only once. CVS patchset: 2074 CVS date: 2002/06/15 10:24:48 --- src/audio_out/audio_alsa_out.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index e71c3c010..c60ac1dc5 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.57 2002/06/13 18:39:17 tmattern Exp $ + * $Id: audio_alsa_out.c,v 1.58 2002/06/15 10:24:48 tmattern Exp $ */ #ifdef HAVE_CONFIG_H @@ -648,7 +648,8 @@ 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 ((result=snd_pcm_pause(this->audio_fd, 1)) < 0) { - printf("audio_alsa_out: Pause call failed, try drop/prepare instead\n"); + printf("audio_alsa_out: Pause call failed err=%d\n", result); + this->has_pause_resume = 0; ao_alsa_ctrl(this_gen, AO_CTRL_FLUSH_BUFFERS); } } else { @@ -659,7 +660,8 @@ static int ao_alsa_ctrl(ao_driver_t *this_gen, int cmd, ...) { case AO_CTRL_PLAY_RESUME: if ((this->has_pause_resume) && (this->audio_fd > 0) ) { if ((result=snd_pcm_pause(this->audio_fd, 0)) < 0) { - printf("Resume call failed err=%d\n",result); + printf("audio_alsa_out: Resume call failed err=%d\n",result); + this->has_pause_resume = 0; } } break; @@ -668,10 +670,10 @@ static int ao_alsa_ctrl(ao_driver_t *this_gen, int cmd, ...) { if (this->audio_fd > 0) { printf("audio_alsa_out: flush buffer\n"); if ((result=snd_pcm_drop(this->audio_fd)) < 0) { - printf("Drop call failed err=%d\n",result); + printf("audio_alsa_out: Drop call failed err=%d\n",result); } if ((result=snd_pcm_prepare(this->audio_fd)) < 0) { - printf("Prepare call failed err=%d\n",result); + printf("audio_alsa_out: Prepare call failed err=%d\n",result); } } break; -- cgit v1.2.3