Commit aa9b31f1 authored by Max Kellermann's avatar Max Kellermann

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.
parent 0f80428f
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "pcm_utils.h" #include "pcm_utils.h"
#include "pipe.h" #include "pipe.h"
#include "audio_format.h" #include "audio_format.h"
#include "tag.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
...@@ -58,6 +59,10 @@ void cross_fade_apply(struct music_chunk *a, const struct music_chunk *b, ...@@ -58,6 +59,10 @@ void cross_fade_apply(struct music_chunk *a, const struct music_chunk *b,
assert(current_chunk <= num_chunks); 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 size = b->length > a->length
? a->length ? a->length
: b->length; : b->length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment