test: pcm_min - add snd_pcm_drain() call and indentation fixes

Fixes: https://github.com/alsa-project/alsa-lib/issues/46
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2020-05-03 20:07:29 +02:00
parent 29041c5220
commit 21e2fc3857

View file

@ -5,8 +5,6 @@
#include "../include/asoundlib.h"
static char *device = "default"; /* playback device */
snd_output_t *output = NULL;
unsigned char buffer[16*1024]; /* some random data */
int main(void)
@ -46,6 +44,10 @@ int main(void)
printf("Short write (expected %li, wrote %li)\n", (long)sizeof(buffer), frames);
}
/* pass the remaining samples, otherwise they're dropped in close */
err = snd_pcm_drain(handle);
if (err < 0)
printf("snd_pcm_drain failed: %s\n", snd_strerror(err));
snd_pcm_close(handle);
return 0;
}