From 060814daa83f6a94f5934464ae42a406c5c7e947 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 27 Sep 2013 22:31:24 +0200 Subject: Log: new logging library API Prepare to migrate away from GLib. Currently, we're still using GLib as a backend. --- src/decoder/FaadDecoderPlugin.cxx | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/decoder/FaadDecoderPlugin.cxx') diff --git a/src/decoder/FaadDecoderPlugin.cxx b/src/decoder/FaadDecoderPlugin.cxx index f026a6216..de846c61a 100644 --- a/src/decoder/FaadDecoderPlugin.cxx +++ b/src/decoder/FaadDecoderPlugin.cxx @@ -26,18 +26,14 @@ #include "tag/TagHandler.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "Log.hxx" #include -#include - #include #include #include -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "faad" - #define AAC_MAX_CHANNELS 6 static const unsigned adts_sample_rates[] = @@ -395,7 +391,7 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is) Error error; ret = faad_decoder_init(decoder, buffer, audio_format, error); if (!ret) { - g_warning("%s", error.GetMessage()); + LogError(error); NeAACDecClose(decoder); return; } @@ -424,21 +420,24 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is) decoded = faad_decoder_decode(decoder, buffer, &frame_info); if (frame_info.error > 0) { - g_warning("error decoding AAC stream: %s\n", - NeAACDecGetErrorMessage(frame_info.error)); + FormatWarning(faad_decoder_domain, + "error decoding AAC stream: %s", + NeAACDecGetErrorMessage(frame_info.error)); break; } if (frame_info.channels != audio_format.channels) { - g_warning("channel count changed from %u to %u", - audio_format.channels, frame_info.channels); + FormatInfo(faad_decoder_domain, + "channel count changed from %u to %u", + audio_format.channels, frame_info.channels); break; } if (frame_info.samplerate != audio_format.sample_rate) { - g_warning("sample rate changed from %u to %lu", - audio_format.sample_rate, - (unsigned long)frame_info.samplerate); + FormatInfo(faad_decoder_domain, + "sample rate changed from %u to %lu", + audio_format.sample_rate, + (unsigned long)frame_info.samplerate); break; } -- cgit v1.2.3