diff options
author | Taylor Holberton <taylorcholberton@gmail.com> | 2019-01-13 13:23:46 -0500 |
---|---|---|
committer | Taylor Holberton <taylorcholberton@gmail.com> | 2019-01-13 13:23:46 -0500 |
commit | 7226172357be3bf7ff591499776cf60c90143cad (patch) | |
tree | 232363dc1cd4d5141dedc9d9480d64ec0c215c5b /examples | |
parent | f6a348d4e74e82591ca1c71a37823802dcabce39 (diff) |
Checking for error in pcm_writei example
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pcm-writei.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/pcm-writei.c b/examples/pcm-writei.c index 2c97f54..c6ea1e2 100644 --- a/examples/pcm-writei.c +++ b/examples/pcm-writei.c @@ -73,7 +73,10 @@ static int write_frames(const void * frames, size_t byte_count){ unsigned int frame_count = pcm_bytes_to_frames(pcm, byte_count); - pcm_writei(pcm, frames, frame_count); + int err = pcm_writei(pcm, frames, frame_count); + if (err != 0) { + printf("error: %s\n", pcm_get_error(pcm)); + } pcm_close(pcm); |