aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/PcmDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-10 18:02:44 +0200
committerMax Kellermann <max@duempel.org>2013-09-04 18:14:22 +0200
commit29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch)
tree79766830b55ebca38ddbce84d8d548227eedb69e /src/decoder/PcmDecoderPlugin.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
downloadmpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'src/decoder/PcmDecoderPlugin.cxx')
-rw-r--r--src/decoder/PcmDecoderPlugin.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/decoder/PcmDecoderPlugin.cxx b/src/decoder/PcmDecoderPlugin.cxx
index 8976f511f..f47b54d03 100644
--- a/src/decoder/PcmDecoderPlugin.cxx
+++ b/src/decoder/PcmDecoderPlugin.cxx
@@ -20,6 +20,7 @@
#include "config.h"
#include "decoder/PcmDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
+#include "util/Error.hxx"
extern "C" {
#include "util/byte_reverse.h"
@@ -46,7 +47,6 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
const bool reverse_endian = mime != nullptr &&
strcmp(mime, "audio/x-mpd-cdda-pcm-reverse") == 0;
- GError *error = nullptr;
enum decoder_command cmd;
const double time_to_size = audio_format.GetTimeToSize();
@@ -81,12 +81,13 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
if (cmd == DECODE_COMMAND_SEEK) {
goffset offset = (goffset)(time_to_size *
decoder_seek_where(decoder));
+
+ Error error;
if (input_stream_lock_seek(is, offset, SEEK_SET,
- &error)) {
+ error)) {
decoder_command_finished(decoder);
} else {
- g_warning("seeking failed: %s", error->message);
- g_error_free(error);
+ g_warning("seeking failed: %s", error.GetMessage());
decoder_seek_error(decoder);
}