aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/VorbisDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-27 22:31:24 +0200
committerMax Kellermann <max@duempel.org>2013-10-02 08:57:55 +0200
commit060814daa83f6a94f5934464ae42a406c5c7e947 (patch)
treef636ec6cdbb8e52fda6db987d2a28fc73c7b94b4 /src/decoder/VorbisDecoderPlugin.cxx
parentc53492a76a8a05825e1c7f699c05645eee891199 (diff)
downloadmpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.gz
mpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.xz
mpd-060814daa83f6a94f5934464ae42a406c5c7e947.zip
Log: new logging library API
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
Diffstat (limited to '')
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index a4a938aa8..55ce943e8 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -20,6 +20,7 @@
#include "config.h"
#include "VorbisDecoderPlugin.h"
#include "VorbisComments.hxx"
+#include "VorbisDomain.hxx"
#include "DecoderAPI.hxx"
#include "InputStream.hxx"
#include "OggCodec.hxx"
@@ -27,6 +28,7 @@
#include "util/UriUtil.hxx"
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
+#include "Log.hxx"
#ifndef HAVE_TREMOR
#define OV_EXCLUDE_STATIC_CALLBACKS
@@ -50,9 +52,6 @@
#include <errno.h>
#include <unistd.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "vorbis"
-
#if G_BYTE_ORDER == G_BIG_ENDIAN
#define VORBIS_BIG_ENDIAN true
#else
@@ -144,8 +143,9 @@ vorbis_is_open(struct vorbis_input_stream *vis, OggVorbis_File *vf,
if (ret < 0) {
if (decoder == NULL ||
decoder_get_command(decoder) == DecoderCommand::NONE)
- g_warning("Failed to open Ogg Vorbis stream: %s",
- vorbis_strerror(ret));
+ FormatWarning(vorbis_domain,
+ "Failed to open Ogg Vorbis stream: %s",
+ vorbis_strerror(ret));
return false;
}
@@ -198,7 +198,7 @@ vorbis_stream_decode(struct decoder *decoder,
const vorbis_info *vi = ov_info(&vf, -1);
if (vi == NULL) {
- g_warning("ov_info() has failed");
+ LogWarning(vorbis_domain, "ov_info() has failed");
return;
}
@@ -211,7 +211,7 @@ vorbis_stream_decode(struct decoder *decoder,
SampleFormat::FLOAT,
#endif
vi->channels, error)) {
- g_warning("%s", error.GetMessage());
+ LogError(error);
return;
}
@@ -272,7 +272,8 @@ vorbis_stream_decode(struct decoder *decoder,
if (current_section != prev_section) {
vi = ov_info(&vf, -1);
if (vi == NULL) {
- g_warning("ov_info() has failed");
+ LogWarning(vorbis_domain,
+ "ov_info() has failed");
break;
}
@@ -280,7 +281,8 @@ vorbis_stream_decode(struct decoder *decoder,
vi->channels != (int)audio_format.channels) {
/* we don't support audio format
change yet */
- g_warning("audio format change, stopping here");
+ LogWarning(vorbis_domain,
+ "audio format change, stopping here");
break;
}