Merge pull request #14 from kyoungpark/master

pcm: add error check for pcm_start in pcm_read
This commit is contained in:
tinyalsa
2012-05-15 17:24:14 -07:00
+4 -1
View File
@@ -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;