aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_utils.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-03 14:52:13 +0100
committerMax Kellermann <max@duempel.org>2009-01-03 14:52:13 +0100
commitd342e338db085e8e8f6eded2aef48c7ca41239ae (patch)
treef5d4af05f24521bf72f8aad87e665c73e9e7c575 /src/pcm_utils.c
parent962f2407d2a3579b7125f937d93d04ccbeb9a453 (diff)
downloadmpd-d342e338db085e8e8f6eded2aef48c7ca41239ae.tar.gz
mpd-d342e338db085e8e8f6eded2aef48c7ca41239ae.tar.xz
mpd-d342e338db085e8e8f6eded2aef48c7ca41239ae.zip
pcm: use GLib instead of utils.h
Diffstat (limited to 'src/pcm_utils.c')
-rw-r--r--src/pcm_utils.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/pcm_utils.c b/src/pcm_utils.c
index a7e7a3990..b1178c7a2 100644
--- a/src/pcm_utils.c
+++ b/src/pcm_utils.c
@@ -19,7 +19,6 @@
#include "pcm_utils.h"
#include "pcm_channels.h"
#include "pcm_prng.h"
-#include "utils.h"
#include "conf.h"
#include "audio_format.h"
@@ -259,7 +258,7 @@ pcm_convert_to_16(struct pcm_convert_state *convert,
*dest_size_r = src_size << 1;
if (*dest_size_r > len) {
len = *dest_size_r;
- buf = xrealloc(buf, len);
+ buf = g_realloc(buf, len);
}
pcm_convert_8_to_16((int16_t *)buf,
@@ -276,7 +275,7 @@ pcm_convert_to_16(struct pcm_convert_state *convert,
*dest_size_r = num_samples * 2;
if (*dest_size_r > len) {
len = *dest_size_r;
- buf = xrealloc(buf, len);
+ buf = g_realloc(buf, len);
}
pcm_convert_24_to_16(&convert->dither,
@@ -324,7 +323,7 @@ pcm_convert_to_24(uint8_t bits, const void *src,
*dest_size_r = src_size * 4;
if (*dest_size_r > len) {
len = *dest_size_r;
- buf = xrealloc(buf, len);
+ buf = g_realloc(buf, len);
}
pcm_convert_8_to_24(buf, (const int8_t *)src,
@@ -336,7 +335,7 @@ pcm_convert_to_24(uint8_t bits, const void *src,
*dest_size_r = num_samples * 4;
if (*dest_size_r > len) {
len = *dest_size_r;
- buf = xrealloc(buf, len);
+ buf = g_realloc(buf, len);
}
pcm_convert_16_to_24(buf, (const int16_t *)src,
@@ -368,14 +367,14 @@ pcm_convert_16(const struct audio_format *src_format,
buf = pcm_convert_to_16(state, src_format->bits,
src_buffer, src_size, &len);
if (!buf)
- exit(EXIT_FAILURE);
+ g_error("pcm_convert_to_16() failed");
if (src_format->channels != dest_format->channels) {
buf = pcm_convert_channels_16(dest_format->channels,
src_format->channels,
buf, len, &len);
if (!buf)
- exit(EXIT_FAILURE);
+ g_error("pcm_convert_channels_16() failed");
}
if (src_format->sample_rate == dest_format->sample_rate) {
@@ -408,14 +407,14 @@ pcm_convert_24(const struct audio_format *src_format,
buf = pcm_convert_to_24(src_format->bits,
src_buffer, src_size, &len);
if (!buf)
- exit(EXIT_FAILURE);
+ g_error("pcm_convert_to_24() failed");
if (src_format->channels != dest_format->channels) {
buf = pcm_convert_channels_24(dest_format->channels,
src_format->channels,
buf, len, &len);
if (!buf)
- exit(EXIT_FAILURE);
+ g_error("pcm_convert_channels_24() failed");
}
if (src_format->sample_rate == dest_format->sample_rate) {