aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pcm.c b/pcm.c
index 2dca157..af175f2 100644
--- a/pcm.c
+++ b/pcm.c
@@ -405,7 +405,10 @@ int pcm_read(struct pcm *pcm, void *data, unsigned int count)
for (;;) {
if (!pcm->running) {
- pcm_start(pcm);
+ if (pcm_start(pcm) < 0) {
+ fprintf(stderr, "start error");
+ return -errno;
+ }
}
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READI_FRAMES, &x)) {
pcm->running = 0;