mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-09 11:26:29 +00:00
Fixed bug 3930 - Android, set thread priorities and names
SDLActivity thread priority is unchanged, by default -10 (THREAD_PRIORITY_VIDEO). SDLAudio thread priority was -4 (SDL_SetThreadPriority was ignored) and is now -16 (THREAD_PRIORITY_AUDIO). SDLThread thread priority was 0 (THREAD_PRIORITY_DEFAULT) and is -4 (THREAD_PRIORITY_DISPLAY).
This commit is contained in:
@@ -695,8 +695,16 @@ SDL_RunAudio(void *devicep)
|
||||
|
||||
SDL_assert(!device->iscapture);
|
||||
|
||||
#if SDL_AUDIO_DRIVER_ANDROID
|
||||
{
|
||||
/* Set thread priority to THREAD_PRIORITY_AUDIO */
|
||||
extern void Android_JNI_AudioSetThreadPriority(int, int);
|
||||
Android_JNI_AudioSetThreadPriority(device->iscapture, device->id);
|
||||
}
|
||||
#else
|
||||
/* The audio mixing is always a high priority thread */
|
||||
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_TIME_CRITICAL);
|
||||
#endif
|
||||
|
||||
/* Perform any thread setup */
|
||||
device->threadid = SDL_ThreadID();
|
||||
@@ -792,8 +800,16 @@ SDL_CaptureAudio(void *devicep)
|
||||
|
||||
SDL_assert(device->iscapture);
|
||||
|
||||
#if SDL_AUDIO_DRIVER_ANDROID
|
||||
{
|
||||
/* Set thread priority to THREAD_PRIORITY_AUDIO */
|
||||
extern void Android_JNI_AudioSetThreadPriority(int, int);
|
||||
Android_JNI_AudioSetThreadPriority(device->iscapture, device->id);
|
||||
}
|
||||
#else
|
||||
/* The audio mixing is always a high priority thread */
|
||||
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
|
||||
#endif
|
||||
|
||||
/* Perform any thread setup */
|
||||
device->threadid = SDL_ThreadID();
|
||||
|
Reference in New Issue
Block a user