aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/pulseaudio.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-27 13:40:43 -0800
committerChris Robinson <[email protected]>2018-12-27 13:40:43 -0800
commit4782d6107d250e3528c5e567dca48da727584ee7 (patch)
tree05679c4196c4dacfce65991fa4caa7862cf1c381 /Alc/backends/pulseaudio.cpp
parent7880f27054cd69cd1e36ebd3d20aa9d6148e3bbd (diff)
Use a proper constructor/destructor for the ALCbackend base
Diffstat (limited to 'Alc/backends/pulseaudio.cpp')
-rw-r--r--Alc/backends/pulseaudio.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp
index 42fc267f..dc7f97b3 100644
--- a/Alc/backends/pulseaudio.cpp
+++ b/Alc/backends/pulseaudio.cpp
@@ -535,6 +535,8 @@ struct PulsePlayback final : public ALCbackend {
ALuint mBufferSize{0u};
ALuint mFrameSize{0u};
+
+ PulsePlayback(ALCdevice *device) noexcept : ALCbackend{device} { }
};
void PulsePlayback_deviceCallback(pa_context *context, const pa_sink_info *info, int eol, void *pdata);
@@ -570,8 +572,7 @@ DEFINE_ALCBACKEND_VTABLE(PulsePlayback);
void PulsePlayback_Construct(PulsePlayback *self, ALCdevice *device)
{
- new (self) PulsePlayback();
- ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
+ new (self) PulsePlayback{device};
SET_VTABLE2(PulsePlayback, ALCbackend, self);
}
@@ -584,7 +585,6 @@ void PulsePlayback_Destruct(PulsePlayback *self)
self->context = nullptr;
self->stream = nullptr;
}
- ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
self->~PulsePlayback();
}
@@ -1182,6 +1182,8 @@ struct PulseCapture final : public ALCbackend {
pa_stream *stream{nullptr};
pa_context *context{nullptr};
+
+ PulseCapture(ALCdevice *device) noexcept : ALCbackend{device} { }
};
void PulseCapture_deviceCallback(pa_context *context, const pa_source_info *info, int eol, void *pdata);
@@ -1214,8 +1216,7 @@ DEFINE_ALCBACKEND_VTABLE(PulseCapture);
void PulseCapture_Construct(PulseCapture *self, ALCdevice *device)
{
- new (self) PulseCapture();
- ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
+ new (self) PulseCapture{device};
SET_VTABLE2(PulseCapture, ALCbackend, self);
}
@@ -1228,7 +1229,6 @@ void PulseCapture_Destruct(PulseCapture *self)
self->context = nullptr;
self->stream = nullptr;
}
- ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
self->~PulseCapture();
}