AudioFormat: replace struct audio_format_string with class StringBuffer, return it

This commit is contained in:
Max Kellermann
2017-01-17 22:04:31 +01:00
parent 4f01387edf
commit 39114f91a7
10 changed files with 36 additions and 53 deletions

View File

@@ -35,6 +35,7 @@
#include "thread/Slack.hxx"
#include "thread/Name.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringBuffer.hxx"
#include "util/ScopeExit.hxx"
#include "util/RuntimeError.hxx"
#include "Log.hxx"
@@ -154,14 +155,11 @@ AudioOutput::Open()
}
}
if (f != source.GetInputAudioFormat() || f != out_audio_format) {
struct audio_format_string afs1, afs2, afs3;
if (f != source.GetInputAudioFormat() || f != out_audio_format)
FormatDebug(output_domain, "converting in=%s -> f=%s -> out=%s",
audio_format_to_string(source.GetInputAudioFormat(),
&afs1),
audio_format_to_string(f, &afs2),
audio_format_to_string(out_audio_format, &afs3));
}
ToString(source.GetInputAudioFormat()).c_str(),
ToString(f).c_str(),
ToString(out_audio_format).c_str());
}
void
@@ -176,11 +174,10 @@ AudioOutput::OpenOutputAndConvert(AudioFormat desired_audio_format)
name, plugin.name));
}
struct audio_format_string af_string;
FormatDebug(output_domain,
"opened plugin=%s name=\"%s\" audio_format=%s",
plugin.name, name,
audio_format_to_string(out_audio_format, &af_string));
ToString(out_audio_format).c_str());
try {
convert_filter_set(convert_filter.Get(), out_audio_format);