From c7a39b8521327a633a0ca8849b38235b59167ea3 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Tue, 17 Nov 2015 01:10:05 -0800 Subject: ao_openal: move uninit before init the next commit will use uninit within init --- audio/out/ao_openal.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'audio/out') diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c index 9207a846b3..2d02139f13 100644 --- a/audio/out/ao_openal.c +++ b/audio/out/ao_openal.c @@ -129,6 +129,18 @@ static const struct speaker speaker_pos[] = { {-1}, }; +// close audio device +static void uninit(struct ao *ao) +{ + ALCcontext *ctx = alcGetCurrentContext(); + ALCdevice *dev = alcGetContextsDevice(ctx); + reset(ao); + alcMakeContextCurrent(NULL); + alcDestroyContext(ctx); + alcCloseDevice(dev); + ao_data = NULL; +} + static int init(struct ao *ao) { float position[3] = {0, 0, 0}; @@ -191,18 +203,6 @@ err_out: return -1; } -// close audio device -static void uninit(struct ao *ao) -{ - ALCcontext *ctx = alcGetCurrentContext(); - ALCdevice *dev = alcGetContextsDevice(ctx); - reset(ao); - alcMakeContextCurrent(NULL); - alcDestroyContext(ctx); - alcCloseDevice(dev); - ao_data = NULL; -} - static void drain(struct ao *ao) { ALint state; -- cgit v1.2.3