aboutsummaryrefslogtreecommitdiffstats
path: root/pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcm.c')
-rw-r--r--pcm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/pcm.c b/pcm.c
index 411db40..0c6afa9 100644
--- a/pcm.c
+++ b/pcm.c
@@ -92,6 +92,22 @@ static int pcm_open(struct snd_pcm_substream *substream)
}
/**
+ * pcm_close - Implements 'close' callback for PCM middle layer
+ * @substream: pointer to ALSA PCM substream
+ *
+ * This is called when a PCM substream is closed.
+ *
+ * Returns 0 on success or error code otherwise.
+ */
+static int pcm_close(struct snd_pcm_substream *substream)
+{
+ // Do additional Audio Path 'close' callback
+ return DO_AUDIOPATH_CB(
+ (struct snd_avirt_audiopath *)PRIVATE_DATA(substream)->audiopath,
+ close, substream);
+}
+
+/**
* pcm_hw_params - Implements 'hw_params' callback for PCM middle layer
* @substream: pointer to ALSA PCM substream
* @hw_params: contains the hardware parameters for the PCM
@@ -154,6 +170,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
*/
struct snd_pcm_ops pcm_ops_avirt = {
.open = pcm_open,
+ .close = pcm_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = pcm_hw_params,
.hw_free = pcm_hw_free,