aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/WavpackDecoderPlugin.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/WavpackDecoderPlugin.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/WavpackDecoderPlugin.cxx')
-rw-r--r--src/decoder/WavpackDecoderPlugin.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/decoder/WavpackDecoderPlugin.cxx b/src/decoder/WavpackDecoderPlugin.cxx
index 6b6c7f2ea..528ecdc3c 100644
--- a/src/decoder/WavpackDecoderPlugin.cxx
+++ b/src/decoder/WavpackDecoderPlugin.cxx
@@ -24,6 +24,7 @@
#include "CheckAudioFormat.hxx"
#include "TagHandler.hxx"
#include "ApeTag.hxx"
+#include "util/Error.hxx"
#include <wavpack/wavpack.h>
#include <glib.h>
@@ -137,7 +138,6 @@ wavpack_bits_to_sample_format(bool is_float, int bytes_per_sample)
static void
wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
{
- GError *error = NULL;
bool is_float;
SampleFormat sample_format;
AudioFormat audio_format;
@@ -150,12 +150,12 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
wavpack_bits_to_sample_format(is_float,
WavpackGetBytesPerSample(wpc));
+ Error error;
if (!audio_format_init_checked(audio_format,
WavpackGetSampleRate(wpc),
sample_format,
- WavpackGetNumChannels(wpc), &error)) {
- g_warning("%s", error->message);
- g_error_free(error);
+ WavpackGetNumChannels(wpc), error)) {
+ g_warning("%s", error.GetMessage());
return;
}
@@ -401,14 +401,16 @@ wavpack_input_get_pos(void *id)
static int
wavpack_input_set_pos_abs(void *id, uint32_t pos)
{
- return input_stream_lock_seek(wpin(id)->is, pos, SEEK_SET, NULL)
+ Error error;
+ return input_stream_lock_seek(wpin(id)->is, pos, SEEK_SET, error)
? 0 : -1;
}
static int
wavpack_input_set_pos_rel(void *id, int32_t delta, int mode)
{
- return input_stream_lock_seek(wpin(id)->is, delta, mode, NULL)
+ Error error;
+ return input_stream_lock_seek(wpin(id)->is, delta, mode, error)
? 0 : -1;
}
@@ -476,7 +478,9 @@ wavpack_open_wvc(struct decoder *decoder, const char *uri,
return nullptr;
wvc_url = g_strconcat(uri, "c", NULL);
- is_wvc = input_stream_open(wvc_url, mutex, cond, NULL);
+
+ Error error;
+ is_wvc = input_stream_open(wvc_url, mutex, cond, error);
g_free(wvc_url);
if (is_wvc == NULL)