input/alsa: use libfmt instead of std::string concatenation

This commit is contained in:
Max Kellermann 2024-07-23 15:03:39 +02:00
parent 4c4a3c8664
commit 18cb34825d
1 changed files with 4 additions and 3 deletions

View File

@ -27,6 +27,8 @@
#include <alsa/asoundlib.h> #include <alsa/asoundlib.h>
#include <fmt/core.h>
#include <cassert> #include <cassert>
#include <string.h> #include <string.h>
@ -182,9 +184,8 @@ AlsaInputStream::AlsaInputStream(EventLoop &_loop,
{ {
OpenDevice(spec); OpenDevice(spec);
std::string mimestr = "audio/x-mpd-alsa-pcm;format="; SetMimeType(fmt::format("audio/x-mpd-alsa-pcm;format={}",
mimestr += spec.GetFormatString(); spec.GetFormatString()));
SetMimeType(mimestr.c_str());
InputStream::SetReady(); InputStream::SetReady();