aboutsummaryrefslogtreecommitdiffstats
path: root/src/crossfade.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-05-02 15:31:31 +0200
committerMax Kellermann <max@duempel.org>2010-05-02 17:46:07 +0200
commit5399a72ec1141307e79970993e4a90a8d643ac50 (patch)
tree87f3ecbbb6c4875f2754dd72b0a577a7b81d652d /src/crossfade.c
parentd093fb2441ee99722670f0401215031fc324bb31 (diff)
downloadmpd-5399a72ec1141307e79970993e4a90a8d643ac50.tar.gz
mpd-5399a72ec1141307e79970993e4a90a8d643ac50.tar.xz
mpd-5399a72ec1141307e79970993e4a90a8d643ac50.zip
player_thread: move cross-fading to output thread
Remove cross_fade_apply(), and call pcm_mix() in the output thread, mixing the chunk and chunk->other together.
Diffstat (limited to '')
-rw-r--r--src/crossfade.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/crossfade.c b/src/crossfade.c
index 7989b1dc9..b494b64b6 100644
--- a/src/crossfade.c
+++ b/src/crossfade.c
@@ -131,46 +131,3 @@ unsigned cross_fade_calc(float duration, float total_time,
return chunks;
}
-
-void cross_fade_apply(struct music_chunk *a, const struct music_chunk *b,
- const struct audio_format *format,
- float mix_ratio)
-{
- size_t size;
-
- assert(a != NULL);
- assert(b != NULL);
- assert(a->length == 0 || b->length == 0 ||
- audio_format_equals(&a->audio_format, &b->audio_format));
-
- if (a->tag == NULL && b->tag != NULL)
- /* merge the tag into the destination chunk */
- a->tag = tag_dup(b->tag);
-
- size = b->length > a->length
- ? a->length
- : b->length;
-
- pcm_mix(a->data,
- b->data,
- size,
- format,
- mix_ratio);
-
- if (b->length > a->length) {
- /* the second buffer is larger than the first one:
- there is unmixed rest at the end. Copy it over.
- The output buffer API guarantees that there is
- enough room in a->data. */
-
-#ifndef NDEBUG
- if (a->length == 0)
- a->audio_format = b->audio_format;
-#endif
-
- memcpy(a->data + a->length,
- b->data + a->length,
- b->length - a->length);
- a->length = b->length;
- }
-}