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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java b/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java
index 94aa49a..b6c7b2c 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java
@@ -23,12 +23,12 @@ public class SDLAudioManager {
private static final AudioDeviceCallback mAudioDeviceCallback = new AudioDeviceCallback() {
@Override
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
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()));
}
};
diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c
index 413c816..5e0b7af 100644
--- a/src/core/android/SDL_android.c
+++ b/src/core/android/SDL_android.c
@@ -1506,7 +1506,7 @@ void Android_DetectDevices(void)
char device_name[64];
SDL_snprintf(device_name, sizeof (device_name), "%d", device_id);
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);
@@ -1518,7 +1518,7 @@ void Android_DetectDevices(void)
char device_name[64];
SDL_snprintf(device_name, sizeof (device_name), "%d", device_id);
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));
}
}