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/portaudio.cpp | |
parent | 7880f27054cd69cd1e36ebd3d20aa9d6148e3bbd (diff) |
Use a proper constructor/destructor for the ALCbackend base
Diffstat (limited to 'Alc/backends/portaudio.cpp')
-rw-r--r-- | Alc/backends/portaudio.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/portaudio.cpp b/Alc/backends/portaudio.cpp index 354389c3..f49c0d2c 100644 --- a/Alc/backends/portaudio.cpp +++ b/Alc/backends/portaudio.cpp @@ -134,6 +134,8 @@ struct ALCportPlayback final : public ALCbackend { PaStream *Stream{nullptr}; PaStreamParameters Params; ALuint UpdateSize{0u}; + + ALCportPlayback(ALCdevice *device) noexcept : ALCbackend{device} { } }; int ALCportPlayback_WriteCallback(const void *inputBuffer, void *outputBuffer, @@ -158,8 +160,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCportPlayback); void ALCportPlayback_Construct(ALCportPlayback *self, ALCdevice *device) { - new (self) ALCportPlayback{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) ALCportPlayback{device}; SET_VTABLE2(ALCportPlayback, ALCbackend, self); } @@ -170,7 +171,6 @@ void ALCportPlayback_Destruct(ALCportPlayback *self) ERR("Error closing stream: %s\n", Pa_GetErrorText(err)); self->Stream = nullptr; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~ALCportPlayback(); } @@ -320,6 +320,8 @@ struct ALCportCapture final : public ALCbackend { PaStreamParameters Params; RingBufferPtr Ring{nullptr}; + + ALCportCapture(ALCdevice *device) noexcept : ALCbackend{device} { } }; int ALCportCapture_ReadCallback(const void *inputBuffer, void *outputBuffer, @@ -344,8 +346,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCportCapture); void ALCportCapture_Construct(ALCportCapture *self, ALCdevice *device) { - new (self) ALCportCapture{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) ALCportCapture{device}; SET_VTABLE2(ALCportCapture, ALCbackend, self); } @@ -356,7 +357,6 @@ void ALCportCapture_Destruct(ALCportCapture *self) ERR("Error closing stream: %s\n", Pa_GetErrorText(err)); self->Stream = nullptr; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~ALCportCapture(); } |