From 18cb34825d15812d6c85485e0d9711ffbaa4e119 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Jul 2024 15:03:39 +0200 Subject: [PATCH] input/alsa: use libfmt instead of std::string concatenation --- src/input/plugins/AlsaInputPlugin.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx index 5a14d43c3..a68827b69 100644 --- a/src/input/plugins/AlsaInputPlugin.cxx +++ b/src/input/plugins/AlsaInputPlugin.cxx @@ -27,6 +27,8 @@ #include +#include + #include #include @@ -182,9 +184,8 @@ AlsaInputStream::AlsaInputStream(EventLoop &_loop, { OpenDevice(spec); - std::string mimestr = "audio/x-mpd-alsa-pcm;format="; - mimestr += spec.GetFormatString(); - SetMimeType(mimestr.c_str()); + SetMimeType(fmt::format("audio/x-mpd-alsa-pcm;format={}", + spec.GetFormatString())); InputStream::SetReady();