mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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:
parent
29041c5220
commit
21e2fc3857
1 changed files with 26 additions and 24 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue