From acf66c220c64579207eeb031c7e0878a6ed28dfa Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sun, 4 Nov 2001 22:49:38 +0000 Subject: Bill's force audio rate patches, preparing for 0.9.4 CVS patchset: 953 CVS date: 2001/11/04 22:49:38 --- src/audio_out/audio_oss_out.c | 6 +----- src/xine-engine/audio_out.c | 5 +++-- src/xine-engine/audio_out.h | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 8c169df46..b1598005d 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.47 2001/10/21 23:14:08 miguelfreitas Exp $ + * $Id: audio_oss_out.c,v 1.48 2001/11/04 22:49:38 guenter Exp $ * * 20-8-2001 First implementation of Audio sync and Audio driver separation. * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -189,10 +189,6 @@ static int ao_oss_open(ao_driver_t *this_gen, ioctl(this->audio_fd,SNDCTL_DSP_SAMPLESIZE,&tmp); tmp = this->input_sample_rate; -#ifdef FORCE_44K_MAX - if(tmp > 44100) - tmp = 44100; -#endif if (ioctl(this->audio_fd,SNDCTL_DSP_SPEED, &tmp) == -1) { printf ("audio_oss_out: warning: sampling rate %d Hz not supported, trying 44100 Hz\n", this->input_sample_rate); diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 442e0c388..ab5cb40f4 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.22 2001/10/16 17:57:31 joachim_koenig Exp $ + * $Id: audio_out.c,v 1.23 2001/11/04 22:49:38 guenter Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe @@ -126,7 +126,7 @@ static int ao_open(ao_instance_t *this, uint32_t bits, uint32_t rate, int mode) { int output_sample_rate; - if ((output_sample_rate=this->driver->open(this->driver,bits,rate,mode)) == 0) { + if ((output_sample_rate=this->driver->open(this->driver,bits,(this->force_rate ? this->force_rate : rate),mode)) == 0) { printf("audio_out: open failed!\n"); return 0; }; @@ -460,6 +460,7 @@ ao_instance_t *ao_new_instance (ao_driver_t *driver, metronom_t *metronom, this->gap_tolerance = driver->get_gap_tolerance (this->driver); this->resample_conf = config->lookup_int (config, "audio_resample_mode", 0); + this->force_rate = config->lookup_int (config, "audio_force_rate", 0); return this; } diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h index 501eac29a..b167f1563 100644 --- a/src/xine-engine/audio_out.h +++ b/src/xine-engine/audio_out.h @@ -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_out.h,v 1.18 2001/10/01 23:04:57 f1rmb Exp $ + * $Id: audio_out.h,v 1.19 2001/11/04 22:49:38 guenter Exp $ */ #ifndef HAVE_AUDIO_OUT_H #define HAVE_AUDIO_OUT_H @@ -175,6 +175,7 @@ struct ao_instance_s { int audio_started; uint32_t last_audio_vpts; int resample_conf; + int force_rate; /* force audio output rate to this value if non-zero */ int do_resample; int mode; int bits; -- cgit v1.2.3