diff options
author | Chris Robinson <[email protected]> | 2009-09-22 04:42:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-09-22 04:42:46 -0700 |
commit | f6c1a21cf0adebdebaa302132055a73028faafde (patch) | |
tree | 856e23297b6126764469f12c14568df0ed8d1479 /Alc | |
parent | c953072a152e73fcdcc58bd6c836302dad6620b8 (diff) |
Properly flip the backend entries when sorting the device list
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -40,13 +40,14 @@ #define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } -static struct { +typedef struct BackendInfo { const char *name; void (*Init)(BackendFuncs*); void (*Deinit)(void); void (*Probe)(int); BackendFuncs Funcs; -} BackendList[] = { +} BackendInfo; +static BackendInfo BackendList[] = { #ifdef HAVE_ALSA { "alsa", alc_alsa_init, alc_alsa_deinit, alc_alsa_probe, EmptyFuncs }, #endif @@ -273,14 +274,9 @@ static void alc_init(void) if(len == strlen(BackendList[n].name) && strncmp(BackendList[n].name, devs, len) == 0) { - const char *name = BackendList[i].name; - void (*Init)(BackendFuncs*) = BackendList[i].Init; - - BackendList[i].name = BackendList[n].name; - BackendList[i].Init = BackendList[n].Init; - - BackendList[n].name = name; - BackendList[n].Init = Init; + BackendInfo Bkp = BackendList[i]; + BackendList[i] = BackendList[n]; + BackendList[n] = Bkp; i++; } |