From: Takashi Iwai Subject: Re: Salsa-lib : _snd_pcm_hw_param_test is not defined Date: Mon, 13 Oct 2008 16:24:22 +0200 Message-ID: References: <48F3198F.50409@parrot.com> <48F354A3.6090501@parrot.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 3AE87244EA for ; Mon, 13 Oct 2008 16:25:05 +0200 (CEST) In-Reply-To: <48F354A3.6090501@parrot.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Matthieu CASTET Cc: ALSA devel List-Id: alsa-devel@alsa-project.org At Mon, 13 Oct 2008 16:01:07 +0200, Matthieu CASTET wrote: > = > Hi, > = > Takashi Iwai a =E9crit : > > At Mon, 13 Oct 2008 11:49:03 +0200, > > Matthieu CASTET wrote: > >> Hi, > >> > >> it seems there is a missing implementation of _snd_pcm_hw_param_test > >> function in src/pcm_params.c . > >> > >> It is used in pcm_macros.h by snd_pcm_hw_params_test_xxx functions. > > = > > Thanks for reporting. = > Thanks for your quick reply. > = > > Does the patch below works? > Hum, > = > dir is a pointer, but _snd_pcm_hw_param_set want a integer. Oops, the fixed patch is below. > = > BTW, some application expect snd_config (from cards.c) to be not null > after a call to snd_config_update. Hm, which apps? Basically the non-null pointer isn't guaranteed even in the API definition, so it's not necessarily to implement. But, if many apps = assume it, it becomes as a de facto standard, and we need to give a workaround... thanks, Takashi diff -r f481dcc66eae src/pcm_params.c --- a/src/pcm_params.c Tue Sep 30 15:38:29 2008 +0200 +++ b/src/pcm_params.c Mon Oct 13 16:22:35 2008 +0200 @@ -754,6 +754,15 @@ return err; } = +int _snd_pcm_hw_param_test(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, + int var, unsigned int val, int *dir) +{ + snd_pcm_hw_params_t save =3D *params; + int err =3D _snd_pcm_hw_param_set(pcm, params, var, val, dir ? *dir : 0); + *params =3D save; + return err; +} + int _snd_pcm_hw_param_set_integer(snd_pcm_t *pcm, = snd_pcm_hw_params_t *params, int var)