From: James Courtier-D. <jcd...@us...> - 2005-07-31 14:39:48
|
Update of /cvsroot/xine/xine-lib/src/audio_out In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15684/xine-lib/src/audio_out Modified Files: audio_alsa_out.c Log Message: Summary: For alsa-lib version 1.0.9 or above, we can detect if the hardware can do resampling or not. If resampling is not supported in hardware, old alsa normally does software resampling, but the current alsa-lib software resampling is not very good quality, so as we can detect if the software resampler is being used, we can choose to use our own high quality resampler. TODO: This requires the addition of a new ./configure detection option HAS_ALSA_1_0_9 Index: audio_alsa_out.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/audio_out/audio_alsa_out.c,v retrieving revision 1.153 retrieving revision 1.154 diff -u -r1.153 -r1.154 --- audio_alsa_out.c 27 Dec 2004 16:55:39 -0000 1.153 +++ audio_alsa_out.c 31 Jul 2005 14:39:39 -0000 1.154 @@ -33,6 +33,9 @@ #include "config.h" #endif +/* TODO: Make ./configure define this */ +// #define HAS_ALSA_1_0_9 + #include <stdio.h> #include <stdarg.h> #include <errno.h> @@ -471,6 +474,10 @@ this->num_channels, err, snd_strerror(err)); goto close; } +#ifdef HAS_ALSA_1_0_9 + /* Restrict a configuration space to contain only real hardware rates */ + err = snd_pcm_hw_params_set_rate_resample(this->audio_fd, params, 0); +#endif /* set the stream rate [Hz] */ dir=0; err = snd_pcm_hw_params_set_rate_near(this->audio_fd, params, &rate, &dir); |