summaryrefslogtreecommitdiff
path: root/src/output/plugins
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-24 12:52:43 +0100
committerMax Kellermann <max@musicpd.org>2018-01-24 13:28:28 +0100
commit97f670658fb0ab21d469eb69510faa8403c99d65 (patch)
tree4925c68092e81c2839afc85855de37d98e8273aa /src/output/plugins
parent4324fb2fbed32533d8efa8c211038ef8fe0b9a0e (diff)
util/StringFormat: new utility library
Diffstat (limited to 'src/output/plugins')
-rw-r--r--src/output/plugins/ShoutOutputPlugin.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/output/plugins/ShoutOutputPlugin.cxx b/src/output/plugins/ShoutOutputPlugin.cxx
index 9332fdaa9..0e78c24f6 100644
--- a/src/output/plugins/ShoutOutputPlugin.cxx
+++ b/src/output/plugins/ShoutOutputPlugin.cxx
@@ -26,6 +26,7 @@
#include "util/Domain.hxx"
#include "util/ScopeExit.hxx"
#include "util/StringAPI.hxx"
+#include "util/StringFormat.hxx"
#include "Log.hxx"
#include <shout/shout.h>
@@ -87,13 +88,11 @@ require_block_string(const ConfigBlock &block, const char *name)
static void
ShoutSetAudioInfo(shout_t *shout_conn, const AudioFormat &audio_format)
{
- char temp[11];
+ shout_set_audio_info(shout_conn, SHOUT_AI_CHANNELS,
+ StringFormat<11>("%u", audio_format.channels));
- snprintf(temp, sizeof(temp), "%u", audio_format.channels);
- shout_set_audio_info(shout_conn, SHOUT_AI_CHANNELS, temp);
-
- snprintf(temp, sizeof(temp), "%u", audio_format.sample_rate);
- shout_set_audio_info(shout_conn, SHOUT_AI_SAMPLERATE, temp);
+ shout_set_audio_info(shout_conn, SHOUT_AI_SAMPLERATE,
+ StringFormat<11>("%u", audio_format.sample_rate));
}
ShoutOutput::ShoutOutput(const ConfigBlock &block)