diff options
author | Max Kellermann <max@duempel.org> | 2013-09-27 22:31:24 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-02 08:57:55 +0200 |
commit | 060814daa83f6a94f5934464ae42a406c5c7e947 (patch) | |
tree | f636ec6cdbb8e52fda6db987d2a28fc73c7b94b4 /src/DecoderAPI.cxx | |
parent | c53492a76a8a05825e1c7f699c05645eee891199 (diff) | |
download | mpd-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/DecoderAPI.cxx')
-rw-r--r-- | src/DecoderAPI.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx index b5f1edf76..3f38a0b5e 100644 --- a/src/DecoderAPI.cxx +++ b/src/DecoderAPI.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "DecoderAPI.hxx" +#include "DecoderError.hxx" #include "AudioConfig.hxx" #include "replay_gain_config.h" #include "MusicChunk.hxx" @@ -29,16 +30,12 @@ #include "Song.hxx" #include "InputStream.hxx" #include "util/Error.hxx" - -#include <glib.h> +#include "Log.hxx" #include <assert.h> #include <stdlib.h> #include <string.h> -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "decoder" - void decoder_initialized(struct decoder *decoder, const AudioFormat audio_format, @@ -67,14 +64,14 @@ decoder_initialized(struct decoder *decoder, dc->client_cond.signal(); dc->Unlock(); - g_debug("audio_format=%s, seekable=%s", - audio_format_to_string(dc->in_audio_format, &af_string), - seekable ? "true" : "false"); + FormatDebug(decoder_domain, "audio_format=%s, seekable=%s", + audio_format_to_string(dc->in_audio_format, &af_string), + seekable ? "true" : "false"); if (dc->in_audio_format != dc->out_audio_format) - g_debug("converting to %s", - audio_format_to_string(dc->out_audio_format, - &af_string)); + FormatDebug(decoder_domain, "converting to %s", + audio_format_to_string(dc->out_audio_format, + &af_string)); } /** @@ -288,7 +285,7 @@ size_t decoder_read(struct decoder *decoder, assert(nbytes > 0 || error.IsDefined() || is->IsEOF()); if (gcc_unlikely(nbytes == 0 && error.IsDefined())) - g_warning("%s", error.GetMessage()); + LogError(error); is->Unlock(); @@ -404,7 +401,7 @@ decoder_data(struct decoder *decoder, /* the PCM conversion has failed - stop playback, since we have no better way to bail out */ - g_warning("%s", error.GetMessage()); + LogError(error); return DecoderCommand::STOP; } } |