From 61ecf838f2775a0e51a6f941838821e2bcd7db9f Mon Sep 17 00:00:00 2001 From: arpi Date: Wed, 4 Dec 2002 22:01:59 +0000 Subject: OK, I think I found why the alsa9 driver was breaking surround sound. ALSA returns the buffer size in _frames_, not bytes, so multiplying by bytes_per_sample is needed. patch by Tom Lees git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8351 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa1x.c | 2 +- libao2/ao_alsa9.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libao2/ao_alsa1x.c b/libao2/ao_alsa1x.c index 5ed8f41ece..67f3ee3bd8 100644 --- a/libao2/ao_alsa1x.c +++ b/libao2/ao_alsa1x.c @@ -628,7 +628,7 @@ static int init(int rate_hz, int channels, int format, int flags) return(0); } else { - ao_data.buffersize = err; + ao_data.buffersize = err * bytes_per_sample; if (verbose>0) printf("alsa-init: got buffersize=%i\n", ao_data.buffersize); } diff --git a/libao2/ao_alsa9.c b/libao2/ao_alsa9.c index 5ed8f41ece..67f3ee3bd8 100644 --- a/libao2/ao_alsa9.c +++ b/libao2/ao_alsa9.c @@ -628,7 +628,7 @@ static int init(int rate_hz, int channels, int format, int flags) return(0); } else { - ao_data.buffersize = err; + ao_data.buffersize = err * bytes_per_sample; if (verbose>0) printf("alsa-init: got buffersize=%i\n", ao_data.buffersize); } -- cgit v1.2.3