aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/jack.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-30 13:04:23 -0700
committerChris Robinson <[email protected]>2019-06-30 16:40:08 -0700
commit0fc30151f2053346005ce9f15da38363a9e62313 (patch)
tree07f5d0edeffab0c84adab56b9ccca7cce55bc54a /Alc/backends/jack.cpp
parent51f53afe12719513b3736a1c73e7de98d7e301ca (diff)
Use an optional for ConfigValueUInt
Diffstat (limited to 'Alc/backends/jack.cpp')
-rw-r--r--Alc/backends/jack.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp
index c58f73bc..99e9019b 100644
--- a/Alc/backends/jack.cpp
+++ b/Alc/backends/jack.cpp
@@ -203,9 +203,9 @@ int JackPlayback::bufferSizeNotify(jack_nframes_t numframes)
mDevice->UpdateSize = numframes;
mDevice->BufferSize = numframes*2;
- ALuint bufsize{mDevice->UpdateSize};
- if(ConfigValueUInt(mDevice->DeviceName.c_str(), "jack", "buffer-size", &bufsize))
- bufsize = maxu(NextPowerOf2(bufsize), mDevice->UpdateSize);
+ const char *devname{mDevice->DeviceName.c_str()};
+ ALuint bufsize{ConfigValueUInt(devname, "jack", "buffer-size").value_or(mDevice->UpdateSize)};
+ bufsize = maxu(NextPowerOf2(bufsize), mDevice->UpdateSize);
mDevice->BufferSize = bufsize + mDevice->UpdateSize;
TRACE("%u / %u buffer\n", mDevice->UpdateSize, mDevice->BufferSize);
@@ -374,9 +374,9 @@ ALCboolean JackPlayback::reset()
mDevice->UpdateSize = jack_get_buffer_size(mClient);
mDevice->BufferSize = mDevice->UpdateSize * 2;
- ALuint bufsize{mDevice->UpdateSize};
- if(ConfigValueUInt(mDevice->DeviceName.c_str(), "jack", "buffer-size", &bufsize))
- bufsize = maxu(NextPowerOf2(bufsize), mDevice->UpdateSize);
+ const char *devname{mDevice->DeviceName.c_str()};
+ ALuint bufsize{ConfigValueUInt(devname, "jack", "buffer-size").value_or(mDevice->UpdateSize)};
+ bufsize = maxu(NextPowerOf2(bufsize), mDevice->UpdateSize);
mDevice->BufferSize = bufsize + mDevice->UpdateSize;
/* Force 32-bit float output. */