diff options
author | tinyalsa <simonwilson@google.com> | 2012-05-15 17:24:14 -0700 |
---|---|---|
committer | tinyalsa <simonwilson@google.com> | 2012-05-15 17:24:14 -0700 |
commit | 80d8254df0294dcb97053c7b42e818595f4792cf (patch) | |
tree | a2ded6e69d034e2a2e12bbf18f4a815f2f79fc6a | |
parent | fcebcad9913c86acd16ca21849bcea16a153f6e5 (diff) | |
parent | 2581a1e4f5a936d8af68c187a8d10c8706c235b3 (diff) |
Merge pull request #14 from kyoungpark/master
pcm: add error check for pcm_start in pcm_read
-rw-r--r-- | pcm.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |