Android JAVA DetectDevices: 'is_capture' is inverted (#6845)

* Android JAVA DetectDevices: 'is_capture' is inversed
* Android Audio: adding audio device. also inverted capture, from jni side
main
Sylvain Becker 2022-12-18 16:55:59 +01:00 committed by GitHub
parent 7fc8533b62
commit 5bf8bc2241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -23,12 +23,12 @@ public class SDLAudioManager {
private static final AudioDeviceCallback mAudioDeviceCallback = new AudioDeviceCallback() { private static final AudioDeviceCallback mAudioDeviceCallback = new AudioDeviceCallback() {
@Override @Override
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) { public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
Arrays.stream(addedDevices).forEach(deviceInfo -> addAudioDevice(deviceInfo.isSink(), deviceInfo.getId())); Arrays.stream(addedDevices).forEach(deviceInfo -> addAudioDevice(deviceInfo.isSource(), deviceInfo.getId()));
} }
@Override @Override
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) { public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
Arrays.stream(removedDevices).forEach(deviceInfo -> removeAudioDevice(deviceInfo.isSink(), deviceInfo.getId())); Arrays.stream(removedDevices).forEach(deviceInfo -> removeAudioDevice(deviceInfo.isSource(), deviceInfo.getId()));
} }
}; };

View File

@ -1498,7 +1498,7 @@ void Android_DetectDevices(void)
char device_name[64]; char device_name[64];
SDL_snprintf(device_name, sizeof (device_name), "%d", device_id); SDL_snprintf(device_name, sizeof (device_name), "%d", device_id);
SDL_Log("Adding input device with name %s", device_name); SDL_Log("Adding input device with name %s", device_name);
SDL_AddAudioDevice(SDL_FALSE, SDL_strdup(device_name), NULL, (void *) ((size_t) device_id + 1)); SDL_AddAudioDevice(SDL_TRUE, SDL_strdup(device_name), NULL, (void *) ((size_t) device_id + 1));
} }
SDL_zeroa(outputs); SDL_zeroa(outputs);
@ -1510,7 +1510,7 @@ void Android_DetectDevices(void)
char device_name[64]; char device_name[64];
SDL_snprintf(device_name, sizeof (device_name), "%d", device_id); SDL_snprintf(device_name, sizeof (device_name), "%d", device_id);
SDL_Log("Adding output device with name %s", device_name); SDL_Log("Adding output device with name %s", device_name);
SDL_AddAudioDevice(SDL_TRUE, SDL_strdup(device_name), NULL, (void *) ((size_t) device_id + 1)); SDL_AddAudioDevice(SDL_FALSE, SDL_strdup(device_name), NULL, (void *) ((size_t) device_id + 1));
} }
} }