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/MpcdecDecoderPlugin.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/decoder/MpcdecDecoderPlugin.cxx') diff --git a/src/decoder/MpcdecDecoderPlugin.cxx b/src/decoder/MpcdecDecoderPlugin.cxx index cfb9c034b..35d5ce0df 100644 --- a/src/decoder/MpcdecDecoderPlugin.cxx +++ b/src/decoder/MpcdecDecoderPlugin.cxx @@ -22,6 +22,7 @@ #include "DecoderAPI.hxx" #include "CheckAudioFormat.hxx" #include "TagHandler.hxx" +#include "util/Error.hxx" #include @@ -53,7 +54,8 @@ mpc_seek_cb(mpc_reader *reader, mpc_int32_t offset) struct mpc_decoder_data *data = (struct mpc_decoder_data *)reader->data; - return input_stream_lock_seek(data->is, offset, SEEK_SET, nullptr); + return input_stream_lock_seek(data->is, offset, SEEK_SET, + IgnoreError()); } static mpc_int32_t @@ -153,13 +155,12 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is) mpc_streaminfo info; mpc_demux_get_info(demux, &info); - GError *error = nullptr; + Error error; AudioFormat audio_format; if (!audio_format_init_checked(audio_format, info.sample_freq, SampleFormat::S24_P32, - info.channels, &error)) { - g_warning("%s", error->message); - g_error_free(error); + info.channels, error)) { + g_warning("%s", error.GetMessage()); mpc_demux_exit(demux); return; } -- cgit v1.2.3