changeset 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 e84c4ee208ca
children e7d59a6ed443
files src/alsa/audio.c src/vorbis/vorbis.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
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
--- a/src/vorbis/vorbis.c	Sun Feb 10 14:47:39 2008 +0300
+++ b/src/vorbis/vorbis.c	Sun Feb 10 15:52:46 2008 +0300
@@ -34,10 +34,8 @@
  */
 
 #include "config.h"
-/*
-#define AUD_DEBUG
-#define DEBUG
-*/
+/*#define AUD_DEBUG
+#define DEBUG*/
 
 #define REMOVE_NONEXISTANT_TAG(x)   if (x != NULL && !*x) { x = NULL; }