aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Biehl Pasquali <pasqualirb@gmail.com>2019-01-07 19:33:13 -0200
committerRicardo Biehl Pasquali <pasqualirb@gmail.com>2019-01-08 13:06:18 -0200
commitf85cf62763b170698a91a7dd176695b581dbe358 (patch)
treecc0529c09bb414669ce3cdd6aa8a932fd7df5f21
parent5f247ef8d5ef39922dde2e2f12c7a2ab7393d34b (diff)
pcm: Prepare after overrun
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
-rw-r--r--src/pcm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 7dec5f7..b02883f 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -760,6 +760,10 @@ int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count)
if (errno == EPIPE) {
/* we failed to make our window -- try to restart */
pcm->underruns++;
+ if (pcm->flags & PCM_NORESTART)
+ return -EPIPE;
+ if (pcm_prepare(pcm))
+ return -EPIPE;
continue;
}
return oops(pcm, errno, "cannot read stream data");