diff options
author | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-05 12:19:54 +0000 |
---|---|---|
committer | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-05 12:19:54 +0000 |
commit | 7e26b4f6fcc783b9a1af8525cbef5924b78bc135 (patch) | |
tree | f70e6118af62c4e217327b911f5a18a2c7cafd7b /src | |
parent | 74a1aa5909349609910f5b3d8ebb3e7661b262c2 (diff) | |
download | xine-lib-7e26b4f6fcc783b9a1af8525cbef5924b78bc135.tar.gz xine-lib-7e26b4f6fcc783b9a1af8525cbef5924b78bc135.tar.bz2 |
Implemented preferred OSS audio device.xine-0_5_0-release0.5.0
Fixed resample selection code.
CVS patchset: 389
CVS date: 2001/08/05 12:19:54
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_oss_out.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 900feb8a0..364c50049 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.24 2001/07/26 19:12:21 guenter Exp $ + * $Id: audio_oss_out.c,v 1.25 2001/08/05 12:19:54 ehasenle Exp $ */ /* required for swab() */ @@ -272,14 +272,16 @@ static int ao_open(ao_functions_t *this_gen, switch (this->resample_conf) { case 1: /* force off */ this->do_resample = 0; + break; case 2: /* force on */ this->do_resample = 1; + break; default: /* AUTO */ this->do_resample = this->output_sample_rate != this->input_sample_rate; - if (this->do_resample) - printf("audio_oss_out: will resample audio from %d to %d\n", - this->input_sample_rate, this->output_sample_rate); } + if (this->do_resample) + printf("audio_oss_out: will resample audio from %d to %d\n", + this->input_sample_rate, this->output_sample_rate); return 1; } @@ -542,9 +544,18 @@ ao_functions_t *init_audio_out_plugin (config_values_t *config) { printf ("audio_oss_out: Opening audio device...\n"); xprintf (VERBOSE|AUDIO, "audio_oss_out: Opening audio device..."); - devnum = 0; + best_rate = 0; - sprintf (this->audio_dev, "/dev/dsp"); + devnum = config->lookup_int (config, "oss_device_num", -1); + + if (devnum >= 0) { + sprintf (this->audio_dev, DSP_TEMPLATE, devnum); + devnum = 30; /* skip while loop */ + } else { + devnum = 0; + sprintf (this->audio_dev, "/dev/dsp"); + } + while (devnum<16) { audio_fd=open(devname,O_WRONLY|O_NDELAY); |