From 447ea618b2950f748bc6b353fbf2cfdc7a08a51c Mon Sep 17 00:00:00 2001 From: David Hampton Date: Thu, 21 Nov 2024 11:54:50 -0500 Subject: [PATCH] tidy: A couple of minor edits to jack audio. 1) Add braces around a couple of else clauses. 2) Use std::max when calculating max latency. https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html https://clang.llvm.org/extra/clang-tidy/checks/readability/use-std-min-max.html --- mythtv/libs/libmyth/audio/audiooutputjack.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmyth/audio/audiooutputjack.cpp b/mythtv/libs/libmyth/audio/audiooutputjack.cpp index 76372a66672..13b7e5688e2 100644 --- a/mythtv/libs/libmyth/audio/audiooutputjack.cpp +++ b/mythtv/libs/libmyth/audio/audiooutputjack.cpp @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -71,7 +72,9 @@ AudioOutputSettings* AudioOutputJACK::GetOutputSettings(bool /*digital*/) goto err_out; } else + { settings->AddSupportedRate(rate); + } // Jack only wants float format samples (de-interleaved for preference) settings->AddSupportedFormat(FORMAT_FLT); @@ -270,7 +273,9 @@ void AudioOutputJACK::DeinterleaveAudio(const float *aubuf, float **bufs, int nf 10000.0); } else + { volumes[channel] = 1.0 / 1.0; // ie no effect + } } if (m_channels == 2) @@ -478,8 +483,7 @@ int AudioOutputJACK::JackGraphOrderCallback(void) { jack_port_get_latency_range( m_ports[i], JackPlaybackLatency, &latency_range ); jack_nframes_t port_latency = latency_range.max; - if (port_latency > max_latency) - max_latency = port_latency; + max_latency = std::max(port_latency, max_latency); } m_jackLatency = max_latency;