aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/alsa.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-07-18 11:10:27 -0700
committerChris Robinson <[email protected]>2022-07-18 11:10:27 -0700
commit650a6d49e9a511d005171940761f6dd6b440ee66 (patch)
tree0ab02b24f5abd14b28be18ac76ae32adddd56135 /alc/backends/alsa.cpp
parent0650d4ee70cdb74dc8829566dfc3e8b12e1ba008 (diff)
Declare variables closer to where they're used
Diffstat (limited to 'alc/backends/alsa.cpp')
-rw-r--r--alc/backends/alsa.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/alc/backends/alsa.cpp b/alc/backends/alsa.cpp
index 9c78b6c6..b6efeaba 100644
--- a/alc/backends/alsa.cpp
+++ b/alc/backends/alsa.cpp
@@ -623,7 +623,6 @@ int AlsaPlayback::mixerNoMMapProc()
void AlsaPlayback::open(const char *name)
{
- al::optional<std::string> driveropt;
const char *driver{"default"};
if(name)
{
@@ -640,7 +639,7 @@ void AlsaPlayback::open(const char *name)
else
{
name = alsaDevice;
- if(bool{driveropt = ConfigValueStr(nullptr, "alsa", "device")})
+ if(auto driveropt = ConfigValueStr(nullptr, "alsa", "device"))
driver = driveropt->c_str();
}
TRACE("Opening device \"%s\"\n", driver);
@@ -896,7 +895,6 @@ AlsaCapture::~AlsaCapture()
void AlsaCapture::open(const char *name)
{
- al::optional<std::string> driveropt;
const char *driver{"default"};
if(name)
{
@@ -913,7 +911,7 @@ void AlsaCapture::open(const char *name)
else
{
name = alsaDevice;
- if(bool{driveropt = ConfigValueStr(nullptr, "alsa", "capture")})
+ if(auto driveropt = ConfigValueStr(nullptr, "alsa", "capture"))
driver = driveropt->c_str();
}