From 29030b54c98b0aee65fbc10ebf7ba36bed98c02c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Aug 2013 18:02:44 +0200 Subject: util/Error: new error passing library Replaces GLib's GError. --- src/decoder/FlacCommon.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/decoder/FlacCommon.cxx') diff --git a/src/decoder/FlacCommon.cxx b/src/decoder/FlacCommon.cxx index 5bcc20b97..62409d3cc 100644 --- a/src/decoder/FlacCommon.cxx +++ b/src/decoder/FlacCommon.cxx @@ -26,6 +26,7 @@ #include "FlacMetadata.hxx" #include "FlacPcm.hxx" #include "CheckAudioFormat.hxx" +#include "util/Error.hxx" #include @@ -68,13 +69,12 @@ flac_got_stream_info(struct flac_data *data, if (data->initialized || data->unsupported) return; - GError *error = nullptr; + Error error; if (!audio_format_init_checked(data->audio_format, stream_info->sample_rate, flac_sample_format(stream_info->bits_per_sample), - stream_info->channels, &error)) { - g_warning("%s", error->message); - g_error_free(error); + stream_info->channels, error)) { + g_warning("%s", error.GetMessage()); data->unsupported = true; return; } @@ -131,13 +131,12 @@ flac_got_first_frame(struct flac_data *data, const FLAC__FrameHeader *header) if (data->unsupported) return false; - GError *error = nullptr; + Error error; if (!audio_format_init_checked(data->audio_format, header->sample_rate, flac_sample_format(header->bits_per_sample), - header->channels, &error)) { - g_warning("%s", error->message); - g_error_free(error); + header->channels, error)) { + g_warning("%s", error.GetMessage()); data->unsupported = true; return false; } -- cgit v1.2.3