output/{alsa,oss}: add assertions

This commit is contained in:
Max Kellermann
2014-08-31 14:00:09 +02:00
parent 4efa96df21
commit af260b5a64
2 changed files with 6 additions and 0 deletions

View File

@@ -802,6 +802,7 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
{
AlsaOutput *ad = (AlsaOutput *)ao;
assert(size > 0);
assert(size % ad->in_frame_size == 0);
if (ad->must_prepare) {
@@ -819,6 +820,7 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
assert(size % ad->out_frame_size == 0);
size /= ad->out_frame_size;
assert(size > 0);
while (true) {
snd_pcm_sframes_t ret = ad->writei(ad->pcm, chunk, size);