output/ao: use class SplitString instead of g_strsplit()

This commit is contained in:
Max Kellermann 2014-12-02 22:29:41 +01:00
parent a66051216f
commit d3d9a04e62

View File

@ -20,6 +20,7 @@
#include "config.h"
#include "AoOutputPlugin.hxx"
#include "../OutputAPI.hxx"
#include "util/SplitString.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
@ -129,19 +130,16 @@ AoOutput::Configure(const config_param &param, Error &error)
gchar **_options = g_strsplit(value, ";", 0);
for (unsigned i = 0; _options[i] != nullptr; ++i) {
gchar **key_value = g_strsplit(_options[i], "=", 2);
const SplitString ss(_options[i], '=');
if (key_value[0] == nullptr || key_value[1] == nullptr) {
if (!ss.IsDefined()) {
error.Format(ao_output_domain,
"problems parsing options \"%s\"",
_options[i]);
return false;
}
ao_append_option(&options, key_value[0],
key_value[1]);
g_strfreev(key_value);
ao_append_option(&options, ss.GetFirst(), ss.GetSecond());
}
g_strfreev(_options);