changeset 9587:f023b30c80e5

replace snd_pcm_drain with snd_pcm_drop
author henry
date Fri, 14 Mar 2003 20:36:26 +0000
parents 2cc1ce724722
children b57a0f03627f
files libao2/ao_alsa1x.c libao2/ao_alsa9.c
diffstat 2 files changed, 20 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_alsa1x.c	Fri Mar 14 17:50:58 2003 +0000
+++ b/libao2/ao_alsa1x.c	Fri Mar 14 20:36:26 2003 +0000
@@ -750,24 +750,17 @@
 {
     int err;
 
-    if (!ao_noblock) {
-      //drain causes error in nonblock-mode!
-      if ((err = snd_pcm_drain(alsa_handler)) < 0)
-	{
-	  printf("alsa-pause: pcm drain error: %s\n", snd_strerror(err));
-	  return;
-	}
-
-      if ((err = snd_pcm_prepare(alsa_handler)) < 0)
-	{
-	  printf("alsa-reset: pcm prepare error: %s\n", snd_strerror(err));
-	  return;
-	}
-    } else {
-      if (verbose>0)
-	printf("alsa-reset: reset nonblocked");
-      return;
+    if ((err = snd_pcm_drop(alsa_handler)) < 0)
+    {
+	printf("alsa-reset: pcm drop error: %s\n", snd_strerror(err));
+	return;
     }
+    if ((err = snd_pcm_prepare(alsa_handler)) < 0)
+    {
+	printf("alsa-reset: pcm prepare error: %s\n", snd_strerror(err));
+	return;
+    }
+    return;
 }
 
 #ifdef USE_POLL
--- a/libao2/ao_alsa9.c	Fri Mar 14 17:50:58 2003 +0000
+++ b/libao2/ao_alsa9.c	Fri Mar 14 20:36:26 2003 +0000
@@ -750,24 +750,17 @@
 {
     int err;
 
-    if (!ao_noblock) {
-      //drain causes error in nonblock-mode!
-      if ((err = snd_pcm_drain(alsa_handler)) < 0)
-	{
-	  printf("alsa-pause: pcm drain error: %s\n", snd_strerror(err));
-	  return;
-	}
-
-      if ((err = snd_pcm_prepare(alsa_handler)) < 0)
-	{
-	  printf("alsa-reset: pcm prepare error: %s\n", snd_strerror(err));
-	  return;
-	}
-    } else {
-      if (verbose>0)
-	printf("alsa-reset: reset nonblocked");
-      return;
+    if ((err = snd_pcm_drop(alsa_handler)) < 0)
+    {
+	printf("alsa-reset: pcm drop error: %s\n", snd_strerror(err));
+	return;
     }
+    if ((err = snd_pcm_prepare(alsa_handler)) < 0)
+    {
+	printf("alsa-reset: pcm prepare error: %s\n", snd_strerror(err));
+	return;
+    }
+    return;
 }
 
 #ifdef USE_POLL