History

Fix macOS default audio device config, since SDL doesn't appreciably list the current default device first

Christopher Snowhill committed 5 years ago

Commit 01c80a11 parent 88b376c1 file · +4 −0Browse files

Unified · Split

src/ft2_audioselector.c+4−0
@@ -24,6 +24,9 @@ char *getAudioOutputDeviceFromConfig(void) · 23 unmodified lines
24 FILE *f = UNICHAR_FOPEN(editor.audioDevConfigFileLocation, "r");24 FILE *f = UNICHAR_FOPEN(editor.audioDevConfigFileLocation, "r");
25 if (f == NULL)25 if (f == NULL)
26 {26 {
27#if defined(__APPLE__)
28 return NULL; // SDL doesn't return devices in any appreciable order, and device 0 is most certainly not guaranteed to be the current default device
29#else
27 const char *devStringTmp = SDL_GetAudioDeviceName(0, false);30 const char *devStringTmp = SDL_GetAudioDeviceName(0, false);
28 if (devStringTmp == NULL)31 if (devStringTmp == NULL)
29 {32 {
@@ -35,6 +38,7 @@ char *getAudioOutputDeviceFromConfig(void) · 5 unmodified lines
35 if (devStringLen > 0)38 if (devStringLen > 0)
36 strncpy(devString, devStringTmp, MAX_DEV_STR_LEN);39 strncpy(devString, devStringTmp, MAX_DEV_STR_LEN);
37 devString[devStringLen+1] = '\0'; // UTF-8 needs double null termination40 devString[devStringLen+1] = '\0'; // UTF-8 needs double null termination
41#endif
38 }42 }
39 else43 else
40 {44 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t