aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/MpcdecDecoderPlugin.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/MpcdecDecoderPlugin.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 'src/decoder/MpcdecDecoderPlugin.cxx')
-rw-r--r--src/decoder/MpcdecDecoderPlugin.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/decoder/MpcdecDecoderPlugin.cxx b/src/decoder/MpcdecDecoderPlugin.cxx
index 252fe92e6..c0785accc 100644
--- a/src/decoder/MpcdecDecoderPlugin.cxx
+++ b/src/decoder/MpcdecDecoderPlugin.cxx
@@ -24,6 +24,8 @@
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "util/Error.hxx"
+#include "util/Domain.hxx"
+#include "Log.hxx"
#include <mpc/mpcdec.h>
@@ -32,14 +34,13 @@
#include <unistd.h>
#include <math.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "mpcdec"
-
struct mpc_decoder_data {
struct input_stream *is;
struct decoder *decoder;
};
+static constexpr Domain mpcdec_domain("mpcdec");
+
static mpc_int32_t
mpc_read_cb(mpc_reader *reader, void *ptr, mpc_int32_t size)
{
@@ -148,7 +149,8 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
mpc_demux *demux = mpc_demux_init(&reader);
if (demux == nullptr) {
if (decoder_get_command(mpd_decoder) != DecoderCommand::STOP)
- g_warning("Not a valid musepack stream");
+ LogWarning(mpcdec_domain,
+ "Not a valid musepack stream");
return;
}
@@ -160,7 +162,7 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
if (!audio_format_init_checked(audio_format, info.sample_freq,
SampleFormat::S24_P32,
info.channels, error)) {
- g_warning("%s", error.GetMessage());
+ LogError(error);
mpc_demux_exit(demux);
return;
}
@@ -199,7 +201,8 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
frame.buffer = (MPC_SAMPLE_FORMAT *)sample_buffer;
mpc_status status = mpc_demux_decode(demux, &frame);
if (status != MPC_STATUS_OK) {
- g_warning("Failed to decode sample");
+ LogWarning(mpcdec_domain,
+ "Failed to decode sample");
break;
}