mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
ao_openal: move uninit before init
the next commit will use uninit within init
This commit is contained in:
parent
5a89150a46
commit
c7a39b8521
@ -129,6 +129,18 @@ static const struct speaker speaker_pos[] = {
|
|||||||
{-1},
|
{-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)
|
static int init(struct ao *ao)
|
||||||
{
|
{
|
||||||
float position[3] = {0, 0, 0};
|
float position[3] = {0, 0, 0};
|
||||||
@ -191,18 +203,6 @@ err_out:
|
|||||||
return -1;
|
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)
|
static void drain(struct ao *ao)
|
||||||
{
|
{
|
||||||
ALint state;
|
ALint state;
|
||||||
|
Loading…
Reference in New Issue
Block a user