From 0526ecd2f95877b167293e50ab8ce0ce614d03f4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 15 Jan 2023 13:43:27 -0800 Subject: clang-tidy cleanups (#800) * clang-tidy: use bool literals Found with modernize-use-bool-literals Signed-off-by: Rosen Penev * clang-tidy: replace std::bind with lambdas Found with modernize-avoid-bind Signed-off-by: Rosen Penev * clang-tidy: use data() instead of pointer stuff Found with readability-container-data-pointe Signed-off-by: Rosen Penev * clang-tidy: use empty() Found with readability-container-size-empty Signed-off-by: Rosen Penev * clang-tidy: remove static in anon namespace Found with readability-static-definition-in-anonymous-namespace Signed-off-by: Rosen Penev * clang-tidy: remove const return Found with readability-const-return-type Signed-off-by: Rosen Penev Signed-off-by: Rosen Penev --- alc/backends/pulseaudio.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'alc/backends/pulseaudio.cpp') diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 3b235c78..9b7e2c08 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -776,7 +776,7 @@ void PulsePlayback::open(const char *name) pa_stream_flags_t flags{PA_STREAM_START_CORKED | PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | PA_STREAM_FIX_CHANNELS}; - if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 1)) + if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", true)) flags |= PA_STREAM_DONT_MOVE; pa_sample_spec spec{}; @@ -834,9 +834,9 @@ bool PulsePlayback::reset() pa_stream_flags_t flags{PA_STREAM_START_CORKED | PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_EARLY_REQUESTS}; - if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 1)) + if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", true)) flags |= PA_STREAM_DONT_MOVE; - if(GetConfigValueBool(mDevice->DeviceName.c_str(), "pulse", "adjust-latency", 0)) + if(GetConfigValueBool(mDevice->DeviceName.c_str(), "pulse", "adjust-latency", false)) { /* ADJUST_LATENCY can't be specified with EARLY_REQUESTS, for some * reason. So if the user wants to adjust the overall device latency, @@ -845,7 +845,7 @@ bool PulsePlayback::reset() flags &= ~PA_STREAM_EARLY_REQUESTS; flags |= PA_STREAM_ADJUST_LATENCY; } - if(GetConfigValueBool(mDevice->DeviceName.c_str(), "pulse", "fix-rate", 0) + if(GetConfigValueBool(mDevice->DeviceName.c_str(), "pulse", "fix-rate", false) || !mDevice->Flags.test(FrequencyRequest)) flags |= PA_STREAM_FIX_RATE; @@ -1190,7 +1190,7 @@ void PulseCapture::open(const char *name) mAttr.fragsize = minu(samples, 50*mDevice->Frequency/1000) * frame_size; pa_stream_flags_t flags{PA_STREAM_START_CORKED | PA_STREAM_ADJUST_LATENCY}; - if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 1)) + if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", true)) flags |= PA_STREAM_DONT_MOVE; TRACE("Connecting to \"%s\"\n", pulse_name ? pulse_name : "(default)"); -- cgit v1.2.3