pipe: added music_buffer, rewrite music_pipe
Turn the music_pipe into a simple music_chunk queue. The music_chunk allocation code is moved to music_buffer, and is now managed with a linked list instead of a ring buffer. Two separate music_pipe objects are used by the decoder for the "current" and the "next" song, which greatly simplifies the cross-fading code.
This commit is contained in:
@@ -196,9 +196,8 @@ static void decoder_run_song(const struct song *song, const char *uri)
|
||||
pcm_convert_deinit(&decoder.conv_state);
|
||||
|
||||
/* flush the last chunk */
|
||||
if (decoder.chunk != NULL &&
|
||||
decoder_flush_chunk(&decoder, NULL) != DECODE_COMMAND_NONE)
|
||||
music_pipe_cancel(decoder.chunk);
|
||||
if (decoder.chunk != NULL)
|
||||
decoder_flush_chunk(&decoder);
|
||||
|
||||
if (close_instream)
|
||||
input_stream_close(&input_stream);
|
||||
|
||||
Reference in New Issue
Block a user