aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 8678919..3d7da0c 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -1637,6 +1637,10 @@ static int pcm_generic_transfer(struct pcm *pcm, void *data,
if (frames > INT_MAX)
return -EINVAL;
+ if (pcm_state(pcm) == PCM_STATE_SETUP && pcm_prepare(pcm) != 0) {
+ return -1;
+ }
+
again:
if (pcm->flags & PCM_MMAP)