aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c3
-rw-r--r--src/chunk.c1
-rw-r--r--src/chunk.h6
3 files changed, 10 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 27a0bf05c..bee871700 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -118,6 +118,9 @@ music_buffer_return(struct music_buffer *buffer, struct music_chunk *chunk)
assert(buffer != NULL);
assert(chunk != NULL);
+ if (chunk->other != NULL)
+ music_buffer_return(buffer, chunk->other);
+
g_mutex_lock(buffer->mutex);
music_chunk_free(chunk);
diff --git a/src/chunk.c b/src/chunk.c
index 5418b6cda..79597506d 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -27,6 +27,7 @@
void
music_chunk_init(struct music_chunk *chunk)
{
+ chunk->other = NULL;
chunk->length = 0;
chunk->tag = NULL;
chunk->replay_gain_serial = 0;
diff --git a/src/chunk.h b/src/chunk.h
index 23f6321fb..a5fdda429 100644
--- a/src/chunk.h
+++ b/src/chunk.h
@@ -44,6 +44,12 @@ struct music_chunk {
/** the next chunk in a linked list */
struct music_chunk *next;
+ /**
+ * An optional chunk which should be mixed into this chunk.
+ * This is used for cross-fading.
+ */
+ struct music_chunk *other;
+
/** number of bytes stored in this chunk */
uint16_t length;