aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-01-07 23:45:51 +0100
committerMax Kellermann <max@duempel.org>2011-01-07 23:45:51 +0100
commit2a56300f7bad00860f5ff44dfea061386173a852 (patch)
tree14b0e78ff162b2e81b505f8b50549c9c88fa7533 /src/player_thread.c
parent5f06999686b1c02c3dc612fe8a6a84ebecc76405 (diff)
downloadmpd-2a56300f7bad00860f5ff44dfea061386173a852.tar.gz
mpd-2a56300f7bad00860f5ff44dfea061386173a852.tar.xz
mpd-2a56300f7bad00860f5ff44dfea061386173a852.zip
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.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 776d6667f..cce51c1a7 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -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 */