diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-10-31 08:15:24 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-10-31 08:15:24 +0200 |
commit | d0005311720baa6883a2d5930b4f70b9e363dce4 (patch) | |
tree | b78b2ff13fe979f86e4f77a62a7fc5c0dfcc5927 /libasound.c | |
parent | f00bac8c036add21438fca10c779f2c03e70a2d5 (diff) |
store hw_param access and implement the getter
Diffstat (limited to 'libasound.c')
-rw-r--r-- | libasound.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libasound.c b/libasound.c index 5dcbdbe..0f2ca45 100644 --- a/libasound.c +++ b/libasound.c @@ -137,6 +137,7 @@ struct _snd_pcm_hw_params { struct sio_cap cap; struct sio_par par; snd_pcm_format_t alsa_format; + snd_pcm_access_t access; bool needs_conversion; // for unsupported formats }; @@ -532,6 +533,7 @@ snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pc if (_access != SND_PCM_ACCESS_RW_INTERLEAVED) goto fail; + params->access = _access; return 0; fail: @@ -539,6 +541,13 @@ fail: return -1; } +int +snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access) +{ + if (_access) *_access = params->access; + return 0; +} + const char* snd_pcm_format_name(const snd_pcm_format_t format) { |