Commit 4ae0e646 authored by Sam Lantinga's avatar Sam Lantinga

Use the plug: ALSA devices for surround sound formats, which have automatic...

Use the plug: ALSA devices for surround sound formats, which have automatic sample format/rate conversion.
Based on feedback from the ALSA development mailing list:
http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022267.html

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%404081
parent ec6a0f32
...@@ -43,9 +43,6 @@ ...@@ -43,9 +43,6 @@
/* The tag name used by ALSA audio */ /* The tag name used by ALSA audio */
#define DRIVER_NAME "alsa" #define DRIVER_NAME "alsa"
/* The default ALSA audio driver */
#define DEFAULT_DEVICE "default"
/* Whether we should set the buffer size or the period size */ /* Whether we should set the buffer size or the period size */
/*#define SET_PERIOD_SIZE*/ /*#define SET_PERIOD_SIZE*/
/*#define DEBUG_PERIOD_SIZE*/ /*#define DEBUG_PERIOD_SIZE*/
...@@ -172,9 +169,17 @@ static const char *get_audio_device(int channels) ...@@ -172,9 +169,17 @@ static const char *get_audio_device(int channels)
device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */ device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */
if ( device == NULL ) { if ( device == NULL ) {
if (channels == 6) device = "surround51"; switch (channels) {
else if (channels == 4) device = "surround40"; case 6:
else device = DEFAULT_DEVICE; device = "plug:surround51";
break;
case 4:
device = "plug:surround40";
break;
default:
device = "default";
break;
}
} }
return device; return device;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment