aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2016-08-03 10:15:46 -0400
committerTaylor Holberton <taylorcholberton@gmail.com>2016-08-03 10:15:46 -0400
commitbb402603a9d5c83c91639624c5c3cb122d4c6132 (patch)
tree400801ddb43fe672a8149f25031b1d8abacb8104
parent6491c7d6d1e1e7a119271e59cf9306c0ccc6726a (diff)
Added get_file_descriptor()
-rw-r--r--include/tinyalsa/asoundlib.h3
-rw-r--r--pcm.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h
index 8fb7c95..d87e357 100644
--- a/include/tinyalsa/asoundlib.h
+++ b/include/tinyalsa/asoundlib.h
@@ -153,6 +153,9 @@ unsigned int pcm_params_get_min(struct pcm_params *pcm_params,
unsigned int pcm_params_get_max(struct pcm_params *pcm_params,
enum pcm_param param);
+/* Returns the file descriptor associated with the pcm */
+int pcm_get_file_descriptor(struct pcm *pcm);
+
/* Returns a human readable reason for the last error */
const char *pcm_get_error(struct pcm *pcm);
diff --git a/pcm.c b/pcm.c
index 2c1308d..707e5f3 100644
--- a/pcm.c
+++ b/pcm.c
@@ -179,6 +179,11 @@ unsigned int pcm_get_buffer_size(struct pcm *pcm)
return pcm->buffer_size;
}
+int pcm_get_file_descriptor(struct pcm *pcm)
+{
+ return pcm->fd;
+}
+
const char* pcm_get_error(struct pcm *pcm)
{
return pcm->error;