浏览代码

n3ds: Check that audio thread name starts with "SDLAudioP"

The string has a number after it, so a basic SDL_strcmp() will never match.

Reference PR #8346.
Ryan C. Gordon 1 年之前
父节点
当前提交
cba6090398
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/thread/n3ds/SDL_systhread.c

+ 1 - 1
src/thread/n3ds/SDL_systhread.c

@@ -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;
     }