diff src/alsa/audio.c @ 2377:9056897525e1

pretend to be stopped when buffer is free. needed for correct waiting for free buffer
author Eugene Zagidullin <e.asphyx@gmail.com>
date Sun, 10 Feb 2008 15:52:46 +0300
parents 415e67d313ad
children 9f1dc50ed75d
line wrap: on
line diff
--- a/src/alsa/audio.c	Sun Feb 10 14:47:39 2008 +0300
+++ b/src/alsa/audio.c	Sun Feb 10 15:52:46 2008 +0300
@@ -29,6 +29,7 @@
  *	Many fixes and cleanups.
  */
 
+/*#define AUD_DEBUG*/
 
 #include "alsa.h"
 #include <ctype.h>
@@ -143,7 +144,10 @@
 	if (!going || paused || alsa_pcm == NULL)
 		return FALSE;
 
-	return snd_pcm_state(alsa_pcm) == SND_PCM_STATE_RUNNING;
+	return snd_pcm_state(alsa_pcm) == SND_PCM_STATE_RUNNING &&
+               !paused &&
+               !prebuffer &&
+               get_thread_buffer_filled() > hw_period_size_in;
 }
 
 static int