Jelajahi Sumber

Use ALooper_pollOnce() instead of ALooper_pollAll()

The structure of the existing loop makes the inner loop of the previous commit unnecessary.
Sam Lantinga 1 tahun lalu
induk
melakukan
558630d59c
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/sensor/android/SDL_androidsensor.c

+ 1 - 1
src/sensor/android/SDL_androidsensor.c

@@ -70,7 +70,7 @@ static int SDLCALL SDL_ANDROID_SensorThread(void *data)
     while (SDL_AtomicGet(&ctx->running)) {
         Uint64 timestamp = SDL_GetTicksNS();
 
-        if (ALooper_pollAll(-1, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
+        if (ALooper_pollOnce(-1, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
             SDL_LockSensors();
             for (i = 0; i < SDL_sensors_count; ++i) {
                 if (!SDL_sensors[i].event_queue) {