diff options
author | Chris Robinson <[email protected]> | 2018-12-27 13:40:43 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-27 13:40:43 -0800 |
commit | 4782d6107d250e3528c5e567dca48da727584ee7 (patch) | |
tree | 05679c4196c4dacfce65991fa4caa7862cf1c381 /Alc/backends/opensl.cpp | |
parent | 7880f27054cd69cd1e36ebd3d20aa9d6148e3bbd (diff) |
Use a proper constructor/destructor for the ALCbackend base
Diffstat (limited to 'Alc/backends/opensl.cpp')
-rw-r--r-- | Alc/backends/opensl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp index e1a0faa6..3aa2d267 100644 --- a/Alc/backends/opensl.cpp +++ b/Alc/backends/opensl.cpp @@ -152,6 +152,8 @@ struct ALCopenslPlayback final : public ALCbackend { std::atomic<ALenum> mKillNow{AL_TRUE}; std::thread mThread; + + ALCopenslPlayback(ALCdevice *device) noexcept : ALCbackend{device} { } }; static void ALCopenslPlayback_process(SLAndroidSimpleBufferQueueItf bq, void *context); @@ -175,8 +177,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCopenslPlayback); static void ALCopenslPlayback_Construct(ALCopenslPlayback *self, ALCdevice *device) { - new (self) ALCopenslPlayback{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) ALCopenslPlayback{device}; SET_VTABLE2(ALCopenslPlayback, ALCbackend, self); } @@ -195,7 +196,6 @@ static void ALCopenslPlayback_Destruct(ALCopenslPlayback* self) self->mEngineObj = NULL; self->mEngine = NULL; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~ALCopenslPlayback(); } @@ -660,6 +660,8 @@ struct ALCopenslCapture final : public ALCbackend { ALCuint mSplOffset{0u}; ALsizei mFrameSize{0}; + + ALCopenslCapture(ALCdevice *device) noexcept : ALCbackend{device} { } }; static void ALCopenslCapture_process(SLAndroidSimpleBufferQueueItf bq, void *context); @@ -681,8 +683,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCopenslCapture); static void ALCopenslCapture_Construct(ALCopenslCapture *self, ALCdevice *device) { - new (self) ALCopenslCapture{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) ALCopenslCapture{device}; SET_VTABLE2(ALCopenslCapture, ALCbackend, self); } @@ -697,7 +698,6 @@ static void ALCopenslCapture_Destruct(ALCopenslCapture *self) self->mEngineObj = NULL; self->mEngine = NULL; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~ALCopenslCapture(); } |