aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/pulseaudio.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-01-13 01:25:20 -0800
committerChris Robinson <[email protected]>2023-01-13 01:25:20 -0800
commit974d1b9e6d174f1680604b2872911110f6a0e41c (patch)
tree8dd9517957717b82977e433276a14b9892b3d563 /alc/backends/pulseaudio.cpp
parent97f2c28ddd79474e163f62d666fc8ce555f31e0f (diff)
Avoid unnecessary uses of make_optional
Diffstat (limited to 'alc/backends/pulseaudio.cpp')
-rw-r--r--alc/backends/pulseaudio.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp
index 5eef8f87..f79e49b0 100644
--- a/alc/backends/pulseaudio.cpp
+++ b/alc/backends/pulseaudio.cpp
@@ -836,7 +836,8 @@ void PulsePlayback::open(const char *name)
pa_stream_set_moved_callback(mStream, &PulsePlayback::streamMovedCallbackC, this);
mFrameSize = static_cast<uint>(pa_frame_size(pa_stream_get_sample_spec(mStream)));
- mDeviceName = pulse_name ? al::make_optional<std::string>(pulse_name) : al::nullopt;
+ if(pulse_name) mDeviceName.emplace(pulse_name);
+ else mDeviceName.reset();
if(!dev_name)
{
pa_operation *op{pa_context_get_sink_info_by_name(mContext,
@@ -1251,7 +1252,8 @@ void PulseCapture::open(const char *name)
pa_stream_set_moved_callback(mStream, &PulseCapture::streamMovedCallbackC, this);
pa_stream_set_state_callback(mStream, &PulseCapture::streamStateCallbackC, this);
- mDeviceName = pulse_name ? al::make_optional<std::string>(pulse_name) : al::nullopt;
+ if(pulse_name) mDeviceName.emplace(pulse_name);
+ else mDeviceName.reset();
if(mDevice->DeviceName.empty())
{
pa_operation *op{pa_context_get_source_info_by_name(mContext,