Skip to content

Commit

Permalink
n3ds: Check that audio thread name starts with "SDLAudioP"
Browse files Browse the repository at this point in the history
The string has a number after it, so a basic SDL_strcmp() will never match.

Reference PR #8346.
  • Loading branch information
icculus committed Oct 25, 2023
1 parent 4194a90 commit cba6090
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/thread/n3ds/SDL_systhread.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread)
svcGetThreadPriority(&priority, CUR_THREAD_HANDLE);

/* prefer putting audio thread on system core */
if (thread->name && SDL_strcmp(thread->name, "SDLAudioP") == 0 && R_SUCCEEDED(APT_SetAppCpuTimeLimit(30))) {
if (thread->name && (SDL_strncmp(thread->name, "SDLAudioP", 9) == 0) && R_SUCCEEDED(APT_SetAppCpuTimeLimit(30))) {
cpu = 1;
}

Expand Down

0 comments on commit cba6090

Please sign in to comment.