aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_resample_libsamplerate.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-29 17:28:49 +0100
committerMax Kellermann <max@duempel.org>2008-12-29 17:28:49 +0100
commite0fe4eb722ac3115ca74080cf100641a91d13236 (patch)
tree2e46449231d9dfc7da66e427e23cd470855c0e44 /src/pcm_resample_libsamplerate.c
parentf4ce43b958719604364c5a840a03781e9ea0ca72 (diff)
downloadmpd-e0fe4eb722ac3115ca74080cf100641a91d13236.tar.gz
mpd-e0fe4eb722ac3115ca74080cf100641a91d13236.tar.xz
mpd-e0fe4eb722ac3115ca74080cf100641a91d13236.zip
pcm: use GLib logging
Diffstat (limited to '')
-rw-r--r--src/pcm_resample_libsamplerate.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/pcm_resample_libsamplerate.c b/src/pcm_resample_libsamplerate.c
index ced4a90b1..1a3656cc4 100644
--- a/src/pcm_resample_libsamplerate.c
+++ b/src/pcm_resample_libsamplerate.c
@@ -19,13 +19,17 @@
#include "pcm_resample.h"
#include "conf.h"
-#include "log.h"
#include "utils.h"
+#include <glib.h>
+
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "pcm"
+
static int pcm_resample_get_converter(void)
{
const char *conf = getConfigParamValue(CONF_SAMPLERATE_CONVERTER);
@@ -54,10 +58,10 @@ static int pcm_resample_get_converter(void)
goto out;
}
- ERROR("unknown samplerate converter \"%s\"\n", conf);
+ g_warning("unknown samplerate converter \"%s\"", conf);
out:
- DEBUG("selecting samplerate converter \"%s\"\n",
- src_get_name(convalgo));
+ g_debug("selecting samplerate converter \"%s\"",
+ src_get_name(convalgo));
return convalgo;
}
@@ -89,15 +93,15 @@ pcm_resample_set(struct pcm_resample_state *state,
state->state = src_new(convalgo, channels, &error);
if (!state->state) {
- ERROR("cannot create new libsamplerate state: %s\n",
- src_strerror(error));
+ g_warning("cannot create new libsamplerate state: %s",
+ src_strerror(error));
state->error = true;
return;
}
data->src_ratio = (double)dest_rate / (double)src_rate;
- DEBUG("setting samplerate conversion ratio to %.2lf\n",
- data->src_ratio);
+ g_debug("setting samplerate conversion ratio to %.2lf",
+ data->src_ratio);
src_set_ratio(state->state, data->src_ratio);
}
@@ -142,8 +146,8 @@ pcm_resample_16(uint8_t channels,
error = src_process(state->state, data);
if (error) {
- ERROR("error processing samples with libsamplerate: %s\n",
- src_strerror(error));
+ g_warning("error processing samples with libsamplerate: %s",
+ src_strerror(error));
state->error = true;
return 0;
}
@@ -215,8 +219,8 @@ pcm_resample_24(uint8_t channels,
error = src_process(state->state, data);
if (error) {
- ERROR("error processing samples with libsamplerate: %s\n",
- src_strerror(error));
+ g_warning("error processing samples with libsamplerate: %s",
+ src_strerror(error));
state->error = true;
return 0;
}