From c470666c579c9d390da9a68022c433fd5ad0a5ff Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 30 Jan 2008 23:39:01 +0000 Subject: Change code to also work with different outburst sizes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25940 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_openal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libao2/ao_openal.c') diff --git a/libao2/ao_openal.c b/libao2/ao_openal.c index f5e4acbd9e..5428f94f2b 100644 --- a/libao2/ao_openal.c +++ b/libao2/ao_openal.c @@ -212,7 +212,7 @@ static int play(void *data, int len, int flags) { int i, j, k; int ch; int16_t *d = data; - len /= ao_data.outburst; + len /= ao_data.channels * CHUNK_SIZE; for (i = 0; i < len; i++) { for (ch = 0; ch < ao_data.channels; ch++) { for (j = 0, k = ch; j < CHUNK_SIZE / 2; j++, k += ao_data.channels) @@ -227,7 +227,7 @@ static int play(void *data, int len, int flags) { alGetSourcei(sources[0], AL_SOURCE_STATE, &state); if (state != AL_PLAYING) // checked here in case of an underrun alSourcePlayv(ao_data.channels, sources); - return len * ao_data.outburst; + return len * ao_data.channels * CHUNK_SIZE; } static float get_delay(void) { -- cgit v1.2.3