chunk: added attribute "other"
Preparation for cross-fading support in the output thread.
This commit is contained in:
@ -118,6 +118,9 @@ music_buffer_return(struct music_buffer *buffer, struct music_chunk *chunk)
|
|||||||
assert(buffer != NULL);
|
assert(buffer != NULL);
|
||||||
assert(chunk != NULL);
|
assert(chunk != NULL);
|
||||||
|
|
||||||
|
if (chunk->other != NULL)
|
||||||
|
music_buffer_return(buffer, chunk->other);
|
||||||
|
|
||||||
g_mutex_lock(buffer->mutex);
|
g_mutex_lock(buffer->mutex);
|
||||||
|
|
||||||
music_chunk_free(chunk);
|
music_chunk_free(chunk);
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
void
|
void
|
||||||
music_chunk_init(struct music_chunk *chunk)
|
music_chunk_init(struct music_chunk *chunk)
|
||||||
{
|
{
|
||||||
|
chunk->other = NULL;
|
||||||
chunk->length = 0;
|
chunk->length = 0;
|
||||||
chunk->tag = NULL;
|
chunk->tag = NULL;
|
||||||
chunk->replay_gain_serial = 0;
|
chunk->replay_gain_serial = 0;
|
||||||
|
@ -44,6 +44,12 @@ struct music_chunk {
|
|||||||
/** the next chunk in a linked list */
|
/** the next chunk in a linked list */
|
||||||
struct music_chunk *next;
|
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 */
|
/** number of bytes stored in this chunk */
|
||||||
uint16_t length;
|
uint16_t length;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user