summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-12-09 11:45:41 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-12-09 11:45:41 +0000
commit26bf51077dca9869a5177b59d011602943b8f9fc (patch)
treeb290d8f0538368831a4d54b911793920dfe96a86 /libao2
parentb4e852b30544d1dbeb4cb3514685b43049316002 (diff)
downloadmpv-26bf51077dca9869a5177b59d011602943b8f9fc.tar.bz2
mpv-26bf51077dca9869a5177b59d011602943b8f9fc.tar.xz
Half-properly set up OpenAL position stuff
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21543 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_openal.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libao2/ao_openal.c b/libao2/ao_openal.c
index fcf14dfd4c..a619236f9a 100644
--- a/libao2/ao_openal.c
+++ b/libao2/ao_openal.c
@@ -60,6 +60,14 @@ static void print_help(void) {
}
static int init(int rate, int channels, int format, int flags) {
+ float position[3] = {0, 0, 0};
+ float direction[6] = {0, 0, 1, 0, 1, 0};
+ float sppos[6][3] = {
+ {-1, 0, 1}, {1, 0, 1},
+ {-1, 0, -1}, {1, 0, -1},
+ {0, 0, 0},
+ {0, 0, 0}
+ };
ALCdevice *dev = NULL;
ALCcontext *ctx = NULL;
ALint bufrate;
@@ -82,13 +90,16 @@ static int init(int rate, int channels, int format, int flags) {
}
ctx = alcCreateContext(dev, NULL);
alcMakeContextCurrent(ctx);
+ alListenerfv(AL_POSITION, position);
+ alListenerfv(AL_ORIENTATION, direction);
+ alGenSources(channels, sources);
for (i = 0; i < channels; i++) {
cur_buf[i] = 0;
unqueue_buf[i] = 0;
alGenBuffers(NUM_BUF, buffers[i]);
+ alSourcefv(sources[i], AL_POSITION, sppos[i]);
+ alSource3f(sources[i], AL_VELOCITY, 0, 0, 0);
}
- alGenSources(channels, sources);
- alSource3f(sources[0], AL_POSITION, 0, 0, 10);
ao_data.channels = channels;
alGetBufferi(buffers[0][0], AL_FREQUENCY, &bufrate);
ao_data.samplerate = rate = bufrate;