From ca77bcd5434d6cfb379a46aeee880f8c2b076872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justas=20Lavi=C5=A1ius?= Date: Tue, 17 Nov 2015 17:03:31 +0200 Subject: ao_openal: fix virtual speaker positioning Place speakers in standard positions equidistant from the listener. use standard coordinate system --- audio/out/ao_openal.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c index 03e6aefc59..58eb1a169c 100644 --- a/audio/out/ao_openal.c +++ b/audio/out/ao_openal.c @@ -118,15 +118,15 @@ struct speaker { }; static const struct speaker speaker_pos[] = { - {MP_SPEAKER_ID_FL, {-1, 0, 0.5}}, - {MP_SPEAKER_ID_FR, { 1, 0, 0.5}}, - {MP_SPEAKER_ID_FC, { 0, 0, 1}}, - {MP_SPEAKER_ID_LFE, { 0, 0, 0.1}}, - {MP_SPEAKER_ID_BL, {-1, 0, -1}}, - {MP_SPEAKER_ID_BR, { 1, 0, -1}}, - {MP_SPEAKER_ID_BC, { 0, 0, -1}}, - {MP_SPEAKER_ID_SL, {-1, 0, 0}}, - {MP_SPEAKER_ID_SR, { 1, 0, 0}}, + {MP_SPEAKER_ID_FL, {-0.500, 0, -0.866}}, // -30 deg + {MP_SPEAKER_ID_FR, { 0.500, 0, -0.866}}, // 30 deg + {MP_SPEAKER_ID_FC, { 0, 0, -1}}, // 0 deg + {MP_SPEAKER_ID_LFE, { 0, -1, 0}}, // below + {MP_SPEAKER_ID_BL, {-0.609, 0, 0.793}}, // -142.5 deg + {MP_SPEAKER_ID_BR, { 0.609, 0, 0.793}}, // -142.5 deg + {MP_SPEAKER_ID_BC, { 0, 0, 1}}, // 180 deg + {MP_SPEAKER_ID_SL, {-0.985, 0, 0.174}}, // -100 deg + {MP_SPEAKER_ID_SR, { 0.985, 0, 0.174}}, // 100 deg {-1}, }; @@ -162,7 +162,7 @@ static void uninit(struct ao *ao) static int init(struct ao *ao) { float position[3] = {0, 0, 0}; - float direction[6] = {0, 0, 1, 0, -1, 0}; + float direction[6] = {0, 0, -1, 0, 1, 0}; ALCdevice *dev = NULL; ALCcontext *ctx = NULL; ALCint freq = 0; -- cgit v1.2.3