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.
This commit is contained in:
Max Kellermann 2008-11-02 20:14:55 +01:00
parent e5137706d1
commit cc164cc884
1 changed files with 3 additions and 0 deletions

View File

@ -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);