Commit 2a56300f authored by Max Kellermann's avatar Max Kellermann

player_thread: discard empty chunks while cross-fading

When a music_chunk to be crossfaded consists only of a tag, cross-fading is not possible, and led to an assertion failure. This patch just discards those, as if cross-fading was not enabled.
parent 5f069996
......@@ -8,6 +8,7 @@ ver 0.16.1 (2010/??/??)
* output:
- solaris: add missing parameter to open_cloexec() cal
- osx: fix up audio format first, then apply it to device
* player_thread: discard empty chunks while cross-fading
* player_thread: fix assertion failure due to early seek
* output_thread: fix double lock
......
......@@ -685,6 +685,19 @@ play_next_chunk(struct player *player)
chunk->mix_ratio = nan("");
}
if (music_chunk_is_empty(other_chunk)) {
/* the "other" chunk was a music_chunk
which had only a tag, but no music
data - we cannot cross-fade that;
but since this happens only at the
beginning of the new song, we can
easily recover by throwing it away
now */
music_buffer_return(player_buffer,
other_chunk);
other_chunk = NULL;
}
chunk->other = other_chunk;
} else {
/* there are not enough decoded chunks yet */
......
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