From 13bf6299d4f6907bcdc97729a17c6172d46637c9 Mon Sep 17 00:00:00 2001 From: Ricardo Biehl Pasquali Date: Wed, 22 Aug 2018 16:10:45 -0300 Subject: pcm: Do prepare action in pcm_open() This eliminates the need for prepare in transfer functions and pcm_start(). Signed-off-by: Ricardo Biehl Pasquali --- src/pcm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pcm.c b/src/pcm.c index 96a5788..f854a94 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -1129,6 +1129,10 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, } #endif + /* prepare here so the user does not need to do this later */ + if (pcm_prepare(pcm)) + goto fail; + pcm->underruns = 0; return pcm; -- cgit v1.2.3