aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/WavpackDecoderPlugin.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/WavpackDecoderPlugin.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/WavpackDecoderPlugin.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/decoder/WavpackDecoderPlugin.cxx b/src/decoder/WavpackDecoderPlugin.cxx
index ecabafefe..8ee898e30 100644
--- a/src/decoder/WavpackDecoderPlugin.cxx
+++ b/src/decoder/WavpackDecoderPlugin.cxx
@@ -25,6 +25,8 @@
#include "tag/TagHandler.hxx"
#include "tag/ApeTag.hxx"
#include "util/Error.hxx"
+#include "util/Domain.hxx"
+#include "Log.hxx"
#include <wavpack/wavpack.h>
#include <glib.h>
@@ -33,11 +35,10 @@
#include <stdio.h>
#include <stdlib.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "wavpack"
-
#define ERRORLEN 80
+static constexpr Domain wavpack_domain("wavpack");
+
/** A pointer type for format converter function. */
typedef void (*format_samples_t)(
int bytes_per_sample,
@@ -155,7 +156,7 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
WavpackGetSampleRate(wpc),
sample_format,
WavpackGetNumChannels(wpc), error)) {
- g_warning("%s", error.GetMessage());
+ LogError(error);
return;
}
@@ -294,10 +295,9 @@ wavpack_scan_file(const char *fname,
wpc = WavpackOpenFileInput(fname, error, OPEN_TAGS, 0);
if (wpc == NULL) {
- g_warning(
- "failed to open WavPack file \"%s\": %s\n",
- fname, error
- );
+ FormatError(wavpack_domain,
+ "failed to open WavPack file \"%s\": %s",
+ fname, error);
return false;
}
@@ -532,7 +532,8 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
);
if (wpc == NULL) {
- g_warning("failed to open WavPack stream: %s\n", error);
+ FormatError(wavpack_domain,
+ "failed to open WavPack stream: %s", error);
return;
}
@@ -558,10 +559,9 @@ wavpack_filedecode(struct decoder *decoder, const char *fname)
OPEN_TAGS | OPEN_WVC | OPEN_NORMALIZE, 23
);
if (wpc == NULL) {
- g_warning(
- "failed to open WavPack file \"%s\": %s\n",
- fname, error
- );
+ FormatWarning(wavpack_domain,
+ "failed to open WavPack file \"%s\": %s",
+ fname, error);
return;
}