aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/sdl2.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/sdl2.c')
-rw-r--r--Alc/backends/sdl2.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Alc/backends/sdl2.c b/Alc/backends/sdl2.c
index cf005024..3495e6bf 100644
--- a/Alc/backends/sdl2.c
+++ b/Alc/backends/sdl2.c
@@ -221,7 +221,7 @@ ALCbackendFactory *ALCsdl2BackendFactory_getFactory(void);
static ALCboolean ALCsdl2BackendFactory_init(ALCsdl2BackendFactory *self);
static void ALCsdl2BackendFactory_deinit(ALCsdl2BackendFactory *self);
static ALCboolean ALCsdl2BackendFactory_querySupport(ALCsdl2BackendFactory *self, ALCbackend_Type type);
-static void ALCsdl2BackendFactory_probe(ALCsdl2BackendFactory *self, enum DevProbe type);
+static void ALCsdl2BackendFactory_probe(ALCsdl2BackendFactory *self, enum DevProbe type, al_string *outnames);
static ALCbackend* ALCsdl2BackendFactory_createBackend(ALCsdl2BackendFactory *self, ALCdevice *device, ALCbackend_Type type);
DEFINE_ALCBACKENDFACTORY_VTABLE(ALCsdl2BackendFactory);
@@ -252,7 +252,7 @@ static ALCboolean ALCsdl2BackendFactory_querySupport(ALCsdl2BackendFactory* UNUS
return ALC_FALSE;
}
-static void ALCsdl2BackendFactory_probe(ALCsdl2BackendFactory* UNUSED(self), enum DevProbe type)
+static void ALCsdl2BackendFactory_probe(ALCsdl2BackendFactory* UNUSED(self), enum DevProbe type, al_string *outnames)
{
int num_devices, i;
al_string name;
@@ -263,12 +263,13 @@ static void ALCsdl2BackendFactory_probe(ALCsdl2BackendFactory* UNUSED(self), enu
AL_STRING_INIT(name);
num_devices = SDL_GetNumAudioDevices(SDL_FALSE);
- AppendAllDevicesList(defaultDeviceName);
+ alstr_append_range(outnames, defaultDeviceName, defaultDeviceName+sizeof(defaultDeviceName));
for(i = 0;i < num_devices;++i)
{
alstr_copy_cstr(&name, DEVNAME_PREFIX);
alstr_append_cstr(&name, SDL_GetAudioDeviceName(i, SDL_FALSE));
- AppendAllDevicesList(alstr_get_cstr(name));
+ if(!alstr_empty(name))
+ alstr_append_range(outnames, VECTOR_BEGIN(name), VECTOR_END(name)+1);
}
alstr_reset(&name);
}