[alsa-devel] Salsa-lib : _snd_pcm_hw_param_test is not defined

Takashi Iwai tiwai at suse.de
Mon Oct 13 12:05:10 CEST 2008


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.  Does the patch below works?


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 12:04:54 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 = *params;
+	int err = _snd_pcm_hw_param_set(pcm, params, var, val, dir);
+	*params = save;
+	return err;
+}
+
 int _snd_pcm_hw_param_set_integer(snd_pcm_t *pcm, 
 				  snd_pcm_hw_params_t *params,
 				  int var)


More information about the Alsa-devel mailing list