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/sndio.cpp | |
parent | 7880f27054cd69cd1e36ebd3d20aa9d6148e3bbd (diff) |
Use a proper constructor/destructor for the ALCbackend base
Diffstat (limited to 'Alc/backends/sndio.cpp')
-rw-r--r-- | Alc/backends/sndio.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp index 027ff9f2..576e9ba9 100644 --- a/Alc/backends/sndio.cpp +++ b/Alc/backends/sndio.cpp @@ -47,6 +47,8 @@ struct SndioPlayback final : public ALCbackend { std::atomic<ALenum> mKillNow{AL_TRUE}; std::thread mThread; + + SndioPlayback(ALCdevice *device) noexcept : ALCbackend{device} { } }; static int SndioPlayback_mixerProc(SndioPlayback *self); @@ -69,8 +71,7 @@ DEFINE_ALCBACKEND_VTABLE(SndioPlayback); static void SndioPlayback_Construct(SndioPlayback *self, ALCdevice *device) { - new (self) SndioPlayback{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) SndioPlayback{device}; SET_VTABLE2(SndioPlayback, ALCbackend, self); } @@ -83,7 +84,6 @@ static void SndioPlayback_Destruct(SndioPlayback *self) al_free(self->mix_data); self->mix_data = nullptr; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~SndioPlayback(); } @@ -283,6 +283,8 @@ struct SndioCapture final : public ALCbackend { std::atomic<ALenum> mKillNow{AL_TRUE}; std::thread mThread; + + SndioCapture(ALCdevice *device) noexcept : ALCbackend{device} { } }; static int SndioCapture_recordProc(SndioCapture *self); @@ -305,8 +307,7 @@ DEFINE_ALCBACKEND_VTABLE(SndioCapture); static void SndioCapture_Construct(SndioCapture *self, ALCdevice *device) { - new (self) SndioCapture{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) SndioCapture{device}; SET_VTABLE2(SndioCapture, ALCbackend, self); } @@ -316,7 +317,6 @@ static void SndioCapture_Destruct(SndioCapture *self) sio_close(self->sndHandle); self->sndHandle = nullptr; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~SndioCapture(); } |