aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-02 20:14:55 +0100
committerMax Kellermann <max@duempel.org>2008-11-02 20:14:55 +0100
commitcc164cc88402bef67b9c12f93fb223450834cc2d (patch)
treea565be78119aab548822528a63e60d53407cd77e
parente5137706d18ba4d42a57bf90b4d1b9d97af1ecf8 (diff)
downloadmpd-cc164cc88402bef67b9c12f93fb223450834cc2d.tar.gz
mpd-cc164cc88402bef67b9c12f93fb223450834cc2d.tar.xz
mpd-cc164cc88402bef67b9c12f93fb223450834cc2d.zip
player: don't play empty chunks
An empty chunk may happen when it only contains a tag, but no PCM data. Don't call playAudio() then.
Diffstat (limited to '')
-rw-r--r--src/player_thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index f0c25a694..e1f31b38c 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -236,6 +236,9 @@ playChunk(struct song *song, struct music_chunk *chunk,
}
}
+ if (chunk->length == 0)
+ return 0;
+
pcm_volume(chunk->data, chunk->length,
format, pc.softwareVolume);