summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_openal.c
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2015-11-17 01:10:05 -0800
committerKevin Mitchell <kevmitch@gmail.com>2015-11-17 01:32:48 -0800
commitc7a39b8521327a633a0ca8849b38235b59167ea3 (patch)
tree6a5c0e228da3218ae92ae2602216a74e513fd98d /audio/out/ao_openal.c
parent5a89150a4652d987f24d7d386d5cdc6d9109e66d (diff)
downloadmpv-c7a39b8521327a633a0ca8849b38235b59167ea3.tar.bz2
mpv-c7a39b8521327a633a0ca8849b38235b59167ea3.tar.xz
ao_openal: move uninit before init
the next commit will use uninit within init
Diffstat (limited to 'audio/out/ao_openal.c')
-rw-r--r--audio/out/ao_openal.c24
1 files changed, 12 insertions, 12 deletions
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;