aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Biehl Pasquali <pasqualirb@gmail.com>2019-01-07 11:54:47 -0200
committerRicardo Biehl Pasquali <pasqualirb@gmail.com>2019-01-08 16:48:19 -0200
commitb38b6a670c359e497926d799cea4d9c80d561eab (patch)
treedeb4ac39015e5686f6765d5d8b7ea6e5dc15b26f
parent0bfac896e66548130c763d015ac16347ced95b84 (diff)
pcm: Check for error after setting appl_ptr
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
-rw-r--r--src/pcm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pcm.c b/src/pcm.c
index ac454b0..3a9deec 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -993,7 +993,8 @@ int pcm_prepare(struct pcm *pcm)
int pcm_start(struct pcm *pcm)
{
/* set appl_ptr and avail_min in kernel */
- pcm_sync_ptr(pcm, 0);
+ if (pcm_sync_ptr(pcm, 0) < 0)
+ return -1;
if (pcm->mmap_status->state != PCM_STATE_RUNNING) {
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_START) < 0)