From f458afaa045730fbc7f7f63151497d127a5fb4ba Mon Sep 17 00:00:00 2001 From: Eduard Hasenleithner Date: Sun, 22 Jul 2001 14:18:22 +0000 Subject: Made resampling switchable through xinerc. CVS patchset: 324 CVS date: 2001/07/22 14:18:22 --- src/audio_out/audio_oss_out.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 84d8dc134..21a6fb833 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_oss_out.c,v 1.22 2001/07/22 11:22:00 ehasenle Exp $ + * $Id: audio_oss_out.c,v 1.23 2001/07/22 14:18:22 ehasenle Exp $ */ /* required for swab() */ @@ -108,6 +108,7 @@ typedef struct oss_functions_s { int audio_started; uint32_t last_audio_vpts; + int resample_conf; int do_resample; } oss_functions_t; @@ -244,7 +245,14 @@ static int ao_open(ao_functions_t *this_gen, ioctl(this->audio_fd,SNDCTL_DSP_SETFRAGMENT,&tmp); */ - this->do_resample = this->output_sample_rate != this->input_sample_rate; + switch (this->resample_conf) { + case 1: /* force off */ + this->do_resample = 0; + case 2: /* force on */ + this->do_resample = 1; + default: /* AUTO */ + this->do_resample = this->output_sample_rate != this->input_sample_rate; + } return 1; } @@ -626,6 +634,8 @@ ao_functions_t *init_audio_out_plugin (config_values_t *config) { close (audio_fd); + this->resample_conf = config->lookup_int (config, "oss_resample", 0); + this->output_sample_rate = 0; this->audio_fd = -1; -- cgit v1.2.3