From f5e75453eae74a601fd6e9a8458883d1166b946f Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 8 Sep 2022 11:41:16 +0200 Subject: [PATCH] Reformat source --- common/utils.hpp | 10 ++++------ server/streamreader/alsa_stream.cpp | 20 +++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/common/utils.hpp b/common/utils.hpp index c25cf997..c7c8b5d0 100644 --- a/common/utils.hpp +++ b/common/utils.hpp @@ -72,12 +72,10 @@ namespace strutils = utils::string; #ifndef WINDOWS static std::string execGetOutput(const std::string& cmd) { - std::shared_ptr<::FILE> pipe(popen((cmd + " 2> /dev/null").c_str(), "r"), - [](::FILE* stream) - { - if (stream != nullptr) - pclose(stream); - }); + std::shared_ptr<::FILE> pipe(popen((cmd + " 2> /dev/null").c_str(), "r"), [](::FILE* stream) { + if (stream != nullptr) + pclose(stream); + }); if (!pipe) return ""; char buffer[1024]; diff --git a/server/streamreader/alsa_stream.cpp b/server/streamreader/alsa_stream.cpp index 95457e88..876832ea 100644 --- a/server/streamreader/alsa_stream.cpp +++ b/server/streamreader/alsa_stream.cpp @@ -54,18 +54,16 @@ template void wait(boost::asio::steady_timer& timer, const std::chrono::duration& duration, std::function handler) { timer.expires_after(duration); - timer.async_wait( - [handler = std::move(handler)](const boost::system::error_code& ec) + timer.async_wait([handler = std::move(handler)](const boost::system::error_code& ec) { + if (ec) { - if (ec) - { - LOG(ERROR, LOG_TAG) << "Error during async wait: " << ec.message() << "\n"; - } - else - { - handler(); - } - }); + LOG(ERROR, LOG_TAG) << "Error during async wait: " << ec.message() << "\n"; + } + else + { + handler(); + } + }); } } // namespace