From: Alan Young <consult.awy@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] [updated] pcm: rate: Add capability to pass configuration node to plugins
Date: Tue, 14 Feb 2017 07:30:22 +0000 [thread overview]
Message-ID: <a15b8e68-a9b5-2ed2-29b2-a0ab5b997d7e@gmail.com> (raw)
In-Reply-To: <s5h4lzxxn9c.wl-tiwai@suse.de>
On 14/02/17 07:08, Takashi Iwai wrote:
> On Mon, 13 Feb 2017 18:20:01 +0100,
> Alan Young wrote:
>> Here is a revised patch.
>>
>> It is useful for the converter used by a rate plugin to be capable of
>> receiving configuration. This patch enables the "converter" node of
>> the configuration of a "type rate" plugin to be specified as a
>> compound and passed to open func of the converter plugin.
>>
>> The SND_PCM_RATE_PLUGIN_CONF_ENTRY macro is used to define a rate
>> converter plugin entry point that takes the additional snd_config_t
>> *conf parameter. If a rate converter plugin also supports the existing
>> SND_PCM_RATE_PLUGIN_ENTRY entry point, or if passed conf parameter is
>> NULL then it is up to the plugin to determine whether or not this is a
>> fatal condition.
>>
>> Alan.
> The changes look almost good, but one uncertain change:
>
>> else if (snd_config_get_type(converter) == SND_CONFIG_TYPE_COMPOUND) {
>> snd_config_iterator_t i, next;
>> snd_config_for_each(i, next, converter) {
>> snd_config_t *n = snd_config_iterator_entry(i);
>> + const char *id;
>> if (snd_config_get_string(n, &type) < 0)
>> break;
>> - err = rate_open_func(rate, type, 0);
>> + err = rate_open_func(rate, type, converter, 0);
>> if (!err)
>> break;
>> + if (snd_config_get_id(n, &id) >= 0 && id && strcmp(id, "0") != 0)
>> + break; /* not a simple array of types */
> What does this check exactly...?
>
In the case that snd_config_get_type(converter) ==
SND_CONFIG_TYPE_COMPOUND, this could be for one of two reasons:
1. Where the configuration contains something like converter {name xxx,
other stuff ...}, or
2. where configuration contains something like [first second third].
In the later case, the id fields will be digit strings, with the first
entry having the id "0". The test simply stops going around the loop
looking for further alternatives if the first did not have id "0".
However, looking at that again now, I see that the test is flawed
because it has no marker to check that it is only applied on the first
iteration, so the loop would always stop after testing the second
alternative. I could fix that or remove the test altogether - what do
you think?
Alan.
next prev parent reply other threads:[~2017-02-14 7:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 15:24 [PATCH] pcm_rate: Do not discard slave reported delay in status result Alan Young
2016-11-17 15:26 ` Alan Young
2016-11-17 16:47 ` Takashi Iwai
2016-11-17 16:51 ` Alan Young
2016-11-17 16:55 ` Takashi Iwai
2016-11-17 17:12 ` [PATCH RESEND] " Alan Young
2016-11-28 19:11 ` Takashi Iwai
2016-12-13 11:43 ` Alan Young
2016-12-13 11:49 ` Takashi Iwai
2016-12-13 13:05 ` Alan Young
2016-12-14 14:29 ` Takashi Iwai
2017-02-08 10:50 ` [PATCH] pcm: rate: Add capability to pass configuration node to plugins Alan Young
2017-02-08 15:36 ` Takashi Iwai
2017-02-09 15:41 ` Alan Young
2017-02-09 15:48 ` Alan Young
2017-02-13 17:20 ` [PATCH] [updated] " Alan Young
2017-02-14 7:08 ` Takashi Iwai
2017-02-14 7:30 ` Alan Young [this message]
2017-02-15 12:28 ` Alan Young
2017-02-17 16:53 ` Takashi Iwai
2017-02-17 17:44 ` Alan Young
2017-02-17 17:59 ` Takashi Iwai
2017-02-21 12:02 ` Alan Young
2017-02-21 12:39 ` Takashi Iwai
2017-02-21 14:34 ` Alan Young
2017-02-21 14:43 ` Takashi Iwai
2017-02-21 15:04 ` Alan Young
2017-02-21 15:14 ` Takashi Iwai
2017-02-21 15:24 ` Alan Young
2017-02-21 15:28 ` Takashi Iwai
2017-02-21 16:14 ` Alan Young
2017-02-21 21:30 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a15b8e68-a9b5-2ed2-29b2-a0ab5b997d7e@gmail.com \
--to=consult.awy@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox