From bb402603a9d5c83c91639624c5c3cb122d4c6132 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Wed, 3 Aug 2016 10:15:46 -0400 Subject: Added get_file_descriptor() --- include/tinyalsa/asoundlib.h | 3 +++ pcm.c | 5 +++++ 2 files changed, 8 insertions(+) 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; -- cgit v1.2.3