aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Stratiienko <r.stratiienko@gmail.com>2022-07-26 17:07:51 +0300
committerRoman Stratiienko <r.stratiienko@gmail.com>2022-07-26 17:09:39 +0300
commit563016b7fe31a8918b3db2a2f2cbb67607ecd153 (patch)
tree016715767b297c6d096207eec817a6615c729903
parent21c5bd46d5f90998661a7509c31e1fd018f9ba70 (diff)
pcm: Propagate error message to the bad_pcm in case of failure
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
-rw-r--r--src/pcm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pcm.c b/src/pcm.c
index d460593..d681563 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -1092,8 +1092,10 @@ struct pcm *pcm_open(unsigned int card, unsigned int device,
}
pcm->subdevice = info.subdevice;
- if (pcm_set_config(pcm, config) != 0)
+ if (pcm_set_config(pcm, config) != 0) {
+ memcpy(bad_pcm.error, pcm->error, sizeof(pcm->error));
goto fail_close;
+ }
rc = pcm_hw_mmap_status(pcm);
if (rc < 0) {