提交 c6718b1b 编写于 作者: Z Zhang Rui

ijksdl: fix audiotrack init with non-stereo channel

上级 b6b76bee
......@@ -61,12 +61,15 @@ jint SDL_AndroidJni_SetupThreadEnv(JNIEnv **p_env)
pthread_once(&g_key_once, make_thread_key);
JNIEnv *env = (JNIEnv*) pthread_getspecific(g_thread_key);
if (!env) {
if ((*jvm)->AttachCurrentThread(jvm, &env, NULL) == JNI_OK) {
pthread_setspecific(g_thread_key, env);
*p_env = env;
return 0;
}
if (env) {
*p_env = env;
return 0;
}
if ((*jvm)->AttachCurrentThread(jvm, &env, NULL) == JNI_OK) {
pthread_setspecific(g_thread_key, env);
*p_env = env;
return 0;
}
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册