aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 565e34b..2ceeb33 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -326,8 +326,9 @@ static int pcm_sync_ptr(struct pcm *pcm, int flags)
pcm->sync_ptr->flags = flags;
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_SYNC_PTR, pcm->sync_ptr) < 0)
return -1;
+ return 0;
}
- return 0;
+ return -1;
}
static int pcm_hw_mmap_status(struct pcm *pcm)
@@ -1088,12 +1089,16 @@ int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset,
int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames)
{
+ int ret;
+
/* not used */
(void) offset;
/* update the application pointer in userspace and kernel */
pcm_mmap_appl_forward(pcm, frames);
- pcm_sync_ptr(pcm, 0);
+ ret = pcm_sync_ptr(pcm, 0);
+ if (ret != 0)
+ return ret;
return frames;
}