summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduard Hasenleithner <ehasenle@users.sourceforge.net>2001-08-05 12:19:54 +0000
committerEduard Hasenleithner <ehasenle@users.sourceforge.net>2001-08-05 12:19:54 +0000
commit7e26b4f6fcc783b9a1af8525cbef5924b78bc135 (patch)
treef70e6118af62c4e217327b911f5a18a2c7cafd7b
parent74a1aa5909349609910f5b3d8ebb3e7661b262c2 (diff)
downloadxine-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
-rw-r--r--doc/README.dxr38
-rw-r--r--doc/README.xinerc6
-rw-r--r--src/audio_out/audio_oss_out.c23
3 files changed, 30 insertions, 7 deletions
diff --git a/doc/README.dxr3 b/doc/README.dxr3
index 318268bda..fe04cd2e0 100644
--- a/doc/README.dxr3
+++ b/doc/README.dxr3
@@ -84,6 +84,12 @@ Some of them are important for dxr3 playback:
set to oss. Can also be specified using "-A oss"
on the command line.
+*) oss_device_num:
+ 0-16 Machines with a dxr3 installed often have an usual
+ soundcard too. If audio playback occurs on the
+ wrong device, the demanded device can be set using
+ this option.
+
It is recommented to run XINE one time before editing the config,
since all options get written in .xinerc and have their default
values. The dxr3 video driver can be forced using the "-V dxr3"
@@ -123,4 +129,4 @@ and dxr3_color_interval too.
________________________
docu version information
-$Id: README.dxr3,v 1.2 2001/07/27 11:42:36 ehasenle Exp $
+$Id: README.dxr3,v 1.3 2001/08/05 12:19:54 ehasenle Exp $
diff --git a/doc/README.xinerc b/doc/README.xinerc
index c9c62f23c..e432ef39f 100644
--- a/doc/README.xinerc
+++ b/doc/README.xinerc
@@ -47,5 +47,11 @@ oss_resample XINE can play different sample rates than your
Dont use, needs missing timer plugin!
2 = ON: Always resample, mainly for debugging.
+oss_device_num -1, 0-16: Forces the OSS plugin to use the specified
+ dspX device, regardless of its capabilities.
+ If -1 (default) is specified, the audio device with
+ the best capabilities will be used.
+ Note: /dev/dsp is usually a symlink to /dev/dsp0
+
dxr3_XXX see README.dxr3
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);