aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authordvdli <dvdli@google.com>2021-01-12 14:53:42 +0800
committerdvdli <dvdli@google.com>2021-01-12 15:55:49 +0800
commit855354a87d2983e190088bc5330c129094b900ca (patch)
tree40c092f7c992e9c6f83edcaf41e9cb0706698890 /utils
parent565fc0e3da9bf0ccea99eb4386a4890cdba56134 (diff)
remove pcm_prepare in pcm_open
For the dynamic pcm device, it is valid to specify the backend after opening it. However, it is invalid to call prepare on a dynamic pcm device without connecting any backend device. We should not do pcm_prepare in pcm_open. See also: Issue #197
Diffstat (limited to 'utils')
-rw-r--r--utils/tinycap.c1
-rw-r--r--utils/tinyplay.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/utils/tinycap.c b/utils/tinycap.c
index 7d4b8a4..e3aa9df 100644
--- a/utils/tinycap.c
+++ b/utils/tinycap.c
@@ -231,6 +231,7 @@ unsigned int capture_sample(FILE *file, unsigned int card, unsigned int device,
pcm_get_error(pcm));
return 0;
}
+ pcm_prepare(pcm);
size = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm));
buffer = malloc(size);
diff --git a/utils/tinyplay.c b/utils/tinyplay.c
index 2689158..482ad24 100644
--- a/utils/tinyplay.c
+++ b/utils/tinyplay.c
@@ -192,6 +192,7 @@ int ctx_init(struct ctx* ctx, const struct cmd *cmd)
pcm_close(ctx->pcm);
return -1;
}
+ pcm_prepare(ctx->pcm);
return 0;
}