mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 15:24:22 -04:00
Merge pull request #14 from kyoungpark/master
pcm: add error check for pcm_start in pcm_read
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user