From 08bb59091c1d262e2a314c61166bfec3f9a31ea0 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Mon, 10 Apr 2017 11:45:44 -0700 Subject: added pcm_get_config() --- src/pcm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/pcm.c') diff --git a/src/pcm.c b/src/pcm.c index b4bbda1..3c19e90 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -215,6 +215,20 @@ unsigned int pcm_get_channels(const struct pcm *pcm) return pcm->config.channels; } +/** Gets the PCM configuration. + * @param pcm A PCM handle. + * @return The PCM configuration. + * This function only returns NULL if + * @p pcm is NULL. + * @ingroup libtinyalsa-pcm + * */ +const struct pcm_config * pcm_get_config(const struct pcm *pcm) +{ + if (pcm == NULL) + return NULL; + return &pcm->config; +} + /** Gets the rate of the PCM. * The rate is given in frames per second. * @param pcm A PCM handle. -- cgit v1.2.3