From 580d261d8762b499e57b8c73308149af1d314a20 Mon Sep 17 00:00:00 2001
From: Jack Moffitt <jack@xiph.org>
Date: Fri, 7 Dec 2001 03:59:27 +0000
Subject: [PATCH] Apparently one some cards the limit is per channel on the
 total buffer size.  So we'll set it lower and multiply by number of output
 channels.

git-svn-id: http://svn.xiph.org/trunk/ao@2432 0101bb08-14d6-0310-b084-bc0e0c8e3800
---
 src/plugins/alsa09/ao_alsa09.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/alsa09/ao_alsa09.c b/src/plugins/alsa09/ao_alsa09.c
index a6c8a39..3260696 100644
--- a/src/plugins/alsa09/ao_alsa09.c
+++ b/src/plugins/alsa09/ao_alsa09.c
@@ -35,7 +35,7 @@
 #include <ao/plugin.h>
 
 #define AO_ALSA_BUF_SIZE 1024
-#define AO_ALSA_PERIODS  32
+#define AO_ALSA_PERIODS  16
 
 static char *ao_alsa_options[] = {
 	"dev",
@@ -207,7 +207,7 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format)
 
 	cmd = "snd_pcm_hw_params_set_periods";
 	err = snd_pcm_hw_params_set_periods(internal->pcm_handle, hwparams,
-			internal->periods, 0);
+			internal->periods * format->channels, 0);
 	if (err < 0)
 		goto error;
 
-- 
GitLab