aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-20 02:25:40 +0200
committerMax Kellermann <max@duempel.org>2011-10-20 02:27:41 +0200
commit13ad2b4dc2a11ab7bad3703cdca050dd55243b6b (patch)
treea27cdf3ef1ba02e0091dd145959bd9d3693668af /src/output_thread.c
parentd01934301776909a705558632ab616fd0153e21f (diff)
downloadmpd-13ad2b4dc2a11ab7bad3703cdca050dd55243b6b.tar.gz
mpd-13ad2b4dc2a11ab7bad3703cdca050dd55243b6b.tar.xz
mpd-13ad2b4dc2a11ab7bad3703cdca050dd55243b6b.zip
pcm_mix: return bool, make unimplemented format non-fatal
Let the caller deal with a failure.
Diffstat (limited to 'src/output_thread.c')
-rw-r--r--src/output_thread.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index e6b815ce0..02c315af9 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -401,8 +401,12 @@ ao_filter_chunk(struct audio_output *ao, const struct music_chunk *chunk,
char *dest = pcm_buffer_get(&ao->cross_fade_buffer,
other_length);
memcpy(dest, other_data, other_length);
- pcm_mix(dest, data, length, ao->in_audio_format.format,
- 1.0 - chunk->mix_ratio);
+ if (!pcm_mix(dest, data, length, ao->in_audio_format.format,
+ 1.0 - chunk->mix_ratio)) {
+ g_warning("Cannot cross-fade format %s",
+ sample_format_to_string(ao->in_audio_format.format));
+ return NULL;
+ }
data = dest;
length = other_length;