From 855354a87d2983e190088bc5330c129094b900ca Mon Sep 17 00:00:00 2001 From: dvdli Date: Tue, 12 Jan 2021 14:53:42 +0800 Subject: 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 --- examples/pcm-readi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/pcm-readi.c') diff --git a/examples/pcm-readi.c b/examples/pcm-readi.c index 8722b41..dc18b63 100644 --- a/examples/pcm-readi.c +++ b/examples/pcm-readi.c @@ -29,6 +29,7 @@ static size_t read_frames(void **frames) fprintf(stderr, "failed to open PCM\n"); return 0; } + pcm_prepare(pcm); unsigned int frame_size = pcm_frames_to_bytes(pcm, 1); unsigned int frames_per_sec = pcm_get_rate(pcm); -- cgit v1.2.3