src/joystick/hidapi/SDL_hidapi_xbox360.c
changeset 13348 448528dc13da
parent 13337 9cbbe45952a4
child 13350 a9ce6aa098b6
equal deleted inserted replaced
13347:99ecd178999f 13348:448528dc13da
   379         return SDL_SetError("Couldn't send rumble packet");
   379         return SDL_SetError("Couldn't send rumble packet");
   380     }
   380     }
   381 #endif /* __WIN32__ */
   381 #endif /* __WIN32__ */
   382 
   382 
   383     if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) {
   383     if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) {
   384         ctx->rumble_expiration = SDL_GetTicks() + duration_ms;
   384         ctx->rumble_expiration = SDL_GetTicks() + SDL_min(duration_ms, SDL_MAX_RUMBLE_DURATION_MS);
   385     } else {
   385     } else {
   386         ctx->rumble_expiration = 0;
   386         ctx->rumble_expiration = 0;
   387     }
   387     }
   388     return 0;
   388     return 0;
   389 }
   389 }