[alsa-devel] snd_seq_parse_address matching prefix

Takashi Iwai tiwai at suse.de
Wed Mar 14 08:26:04 CET 2012

At Tue, 13 Mar 2012 23:46:52 +0100 (CET),
Henning Thielemann wrote:
> snd_seq_parse_address(seq, addr, "foo") does not look for a client named 
> "foo" but for a client with prefix "foo". I always found this to be a 
> feature, not a bug, although it is not documented. Is this behavior 
> intended? If yes, how to cope with the case where one client's name is the
> prefix of another one? E.g. let the clients be
> "foobar"
> "foo"
> (in this order)
> then parsing "foo" will return the client address of "foobar", not that of 
> "foo". Even more there is no prefix that will select "foo", but not 
> "foobar".
>   Sorting the clients with respect to increasing name lengths and then 
> searching for matching prefixes in the sorted list would solve that 
> problem.

Yes, it's the intended behavior.  When I implemented it, I was too
annoyed by typing the all name string :)

> Currently it's only a theoretical problem but if that behavior is intended 
> it should at least be documented. Using snd_seq_query_next_client everyone 
> can write his own parse_address. We should only know about the theoretical 
> problem.

Care to send a patch for the updated document?



More information about the Alsa-devel mailing list