From 36cc1daad8bf9c212cf6975a7500026c9b7a2f5e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 13 Mar 2007 10:44:28 +0100 Subject: [PATCH] Remove _snd_pcm_link_descriptors() and more comments Removed the obsoleted _snd_pcm_link_descriptors() from pcm_local.h. Added more comments on multi plugin. --- src/pcm/pcm_local.h | 1 - src/pcm/pcm_multi.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h index afb6b9be..ecf2e1d8 100644 --- a/src/pcm/pcm_local.h +++ b/src/pcm/pcm_local.h @@ -274,7 +274,6 @@ static inline int snd_pcm_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t *i } int snd_pcm_channel_info_shm(snd_pcm_t *pcm, snd_pcm_channel_info_t *info, int shmid); int _snd_pcm_poll_descriptor(snd_pcm_t *pcm); -int _snd_pcm_link_descriptors(snd_pcm_t *pcm, int *fds, int size, int (**failed)(snd_pcm_t *, int)); #define _snd_pcm_link_descriptor _snd_pcm_poll_descriptor /* FIXME */ #define _snd_pcm_async_descriptor _snd_pcm_poll_descriptor /* FIXME */ diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c index 7e1cc1c9..94bcf50a 100644 --- a/src/pcm/pcm_multi.c +++ b/src/pcm/pcm_multi.c @@ -313,6 +313,10 @@ static int snd_pcm_multi_hw_params_slave(snd_pcm_t *pcm, return 0; } +/* reset links to the normal state + * slave #0 = trigger master + * slave #1-(N-1) = trigger slaves, linked is set to #0 + */ static void reset_links(snd_pcm_multi_t *multi) { unsigned int i; @@ -457,6 +461,10 @@ static int snd_pcm_multi_reset(snd_pcm_t *pcm) return result; } +/* when the first slave PCM is linked, it means that the whole multi + * plugin instance is linked manually to another PCM. in this case, + * we need to trigger the master. + */ static int snd_pcm_multi_start(snd_pcm_t *pcm) { snd_pcm_multi_t *multi = pcm->private_data; @@ -616,6 +624,9 @@ static int snd_pcm_multi_resume(snd_pcm_t *pcm) return err; } +/* if a multi plugin instance is linked as slaves, every slave PCMs + * including the first one has to be relinked to the given master. + */ static int snd_pcm_multi_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master) { snd_pcm_multi_t *multi = pcm->private_data; @@ -635,6 +646,9 @@ static int snd_pcm_multi_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master) return 0; } +/* linking to a multi as a master is easy - simply link to the first + * slave element as its own slaves are already linked. + */ static int snd_pcm_multi_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) { snd_pcm_multi_t *multi = pcm1->private_data; -- 2.47.1