aboutsummaryrefslogtreecommitdiffstats
path: root/src/crossfade.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-02 17:07:13 +0100
committerMax Kellermann <max@duempel.org>2008-11-02 17:07:13 +0100
commitaa9b31f1cfdb8a05cc739c67a33ba5b7a84d8f51 (patch)
treeeaf3696efc5a4971d8ce10266cbaddc6ac764840 /src/crossfade.c
parent0f80428fdac074a5bf17a70d25c909d503594bf6 (diff)
downloadmpd-aa9b31f1cfdb8a05cc739c67a33ba5b7a84d8f51.tar.gz
mpd-aa9b31f1cfdb8a05cc739c67a33ba5b7a84d8f51.tar.xz
mpd-aa9b31f1cfdb8a05cc739c67a33ba5b7a84d8f51.zip
crossfade: copy tag
If the source chunk has a tag, merge it into the destination chunk. The source chunk gets deleted after that, and this is our last chance to grab the tag.
Diffstat (limited to 'src/crossfade.c')
-rw-r--r--src/crossfade.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/crossfade.c b/src/crossfade.c
index a65d304e8..ac2461689 100644
--- a/src/crossfade.c
+++ b/src/crossfade.c
@@ -22,6 +22,7 @@
#include "pcm_utils.h"
#include "pipe.h"
#include "audio_format.h"
+#include "tag.h"
#include <assert.h>
#include <string.h>
@@ -58,6 +59,10 @@ void cross_fade_apply(struct music_chunk *a, const struct music_chunk *b,
assert(current_chunk <= num_chunks);
+ 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;