aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/OpusDecoderPlugin.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/OpusDecoderPlugin.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/OpusDecoderPlugin.cxx')
-rw-r--r--src/decoder/OpusDecoderPlugin.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx
index ea1d6660c..96c52a083 100644
--- a/src/decoder/OpusDecoderPlugin.cxx
+++ b/src/decoder/OpusDecoderPlugin.cxx
@@ -19,6 +19,7 @@
#include "config.h" /* must be first for large file support */
#include "OpusDecoderPlugin.h"
+#include "OpusDomain.hxx"
#include "OpusHead.hxx"
#include "OpusTags.hxx"
#include "OggUtil.hxx"
@@ -31,6 +32,7 @@
#include "tag/TagBuilder.hxx"
#include "InputStream.hxx"
#include "util/Error.hxx"
+#include "Log.hxx"
#include <opus.h>
#include <ogg/ogg.h>
@@ -40,9 +42,6 @@
#include <stdio.h>
#include <string.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "opus"
-
static const opus_int32 opus_sample_rate = 48000;
gcc_pure
@@ -62,7 +61,7 @@ IsOpusTags(const ogg_packet &packet)
static bool
mpd_opus_init(gcc_unused const config_param &param)
{
- g_debug("%s", opus_get_version_string());
+ LogDebug(opus_domain, opus_get_version_string());
return true;
}
@@ -199,8 +198,8 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
opus_decoder = opus_decoder_create(opus_sample_rate, channels,
&opus_error);
if (opus_decoder == nullptr) {
- g_warning("libopus error: %s",
- opus_strerror(opus_error));
+ FormatError(opus_domain, "libopus error: %s",
+ opus_strerror(opus_error));
return DecoderCommand::STOP;
}
@@ -249,7 +248,7 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
output_buffer, output_size,
0);
if (nframes < 0) {
- g_warning("%s", opus_strerror(nframes));
+ LogError(opus_domain, opus_strerror(nframes));
return DecoderCommand::STOP;
}