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 <fmt/core.h>
#include <cassert>
#include <string.h>
@ -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();