aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/VorbisDecoderPlugin.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/VorbisDecoderPlugin.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/VorbisDecoderPlugin.cxx')
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index b9181ef75..3626fe162 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -23,6 +23,7 @@
#include "DecoderAPI.hxx"
#include "InputStream.hxx"
#include "OggCodec.hxx"
+#include "util/Error.hxx"
#include "util/UriUtil.hxx"
#include "CheckAudioFormat.hxx"
#include "TagHandler.hxx"
@@ -80,9 +81,10 @@ static int ogg_seek_cb(void *data, ogg_int64_t offset, int whence)
{
struct vorbis_input_stream *vis = (struct vorbis_input_stream *)data;
+ Error error;
return vis->seekable &&
(!vis->decoder || decoder_get_command(vis->decoder) != DECODE_COMMAND_STOP) &&
- input_stream_lock_seek(vis->input_stream, offset, whence, NULL)
+ input_stream_lock_seek(vis->input_stream, offset, whence, error)
? 0 : -1;
}
@@ -182,14 +184,12 @@ static void
vorbis_stream_decode(struct decoder *decoder,
struct input_stream *input_stream)
{
- GError *error = NULL;
-
if (ogg_codec_detect(decoder, input_stream) != OGG_CODEC_VORBIS)
return;
/* rewind the stream, because ogg_codec_detect() has
moved it */
- input_stream_lock_seek(input_stream, 0, SEEK_SET, NULL);
+ input_stream_lock_seek(input_stream, 0, SEEK_SET, IgnoreError());
struct vorbis_input_stream vis;
OggVorbis_File vf;
@@ -202,6 +202,7 @@ vorbis_stream_decode(struct decoder *decoder,
return;
}
+ Error error;
AudioFormat audio_format;
if (!audio_format_init_checked(audio_format, vi->rate,
#ifdef HAVE_TREMOR
@@ -209,9 +210,8 @@ vorbis_stream_decode(struct decoder *decoder,
#else
SampleFormat::FLOAT,
#endif
- vi->channels, &error)) {
- g_warning("%s", error->message);
- g_error_free(error);
+ vi->channels, error)) {
+ g_warning("%s", error.GetMessage());
return;
}