|
@@ -983,9 +983,13 @@ static Thing *CreatePhysicalDeviceThing(const SDL_AudioDeviceID which, const SDL
|
|
|
SDL_Log("Adding physical audio device %u", (unsigned int) which);
|
|
|
thing = CreateThing(recording ? THING_PHYSDEV_RECORDING : THING_PHYSDEV, next_physdev_x, 170, 5, -1, -1, physdev_texture, NULL);
|
|
|
if (thing) {
|
|
|
+ const char *name = SDL_GetAudioDeviceName(which);
|
|
|
+ if (!name) {
|
|
|
+ name = "[Unnamed device]";
|
|
|
+ }
|
|
|
thing->data.physdev.devid = which;
|
|
|
thing->data.physdev.recording = recording;
|
|
|
- thing->data.physdev.name = SDL_strdup(SDL_GetAudioDeviceName(which));
|
|
|
+ thing->data.physdev.name = SDL_strdup(name);
|
|
|
thing->ondrag = DeviceThing_ondrag;
|
|
|
thing->ondrop = PhysicalDeviceThing_ondrop;
|
|
|
thing->ontick = PhysicalDeviceThing_ontick;
|