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

@@ -24,6 +24,7 @@
#include "filter/FilterRegistry.hxx"
#include "AudioFormat.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringBuffer.hxx"
#include "util/RuntimeError.hxx"
#include <memory>
@@ -108,10 +109,9 @@ PreparedChainFilter::Child::Open(const AudioFormat &prev_audio_format)
if (conv_audio_format != prev_audio_format) {
delete new_filter;
struct audio_format_string s;
throw FormatRuntimeError("Audio format not supported by filter '%s': %s",
name,
audio_format_to_string(prev_audio_format, &s));
ToString(prev_audio_format).c_str());
}
return new_filter;