Fix error texts in saf_open/saf_close

pull/846/head
Artyom Zavrin 2 years ago
parent 1b406dcc6b
commit e53cad6404
  1. 8
      android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c

@ -575,11 +575,11 @@ int saf_open(int safId) {
jint getEnvRc = (*globalVm)->GetEnv(globalVm, (void**) &env, JNI_VERSION_1_6); jint getEnvRc = (*globalVm)->GetEnv(globalVm, (void**) &env, JNI_VERSION_1_6);
if (getEnvRc != JNI_OK) { if (getEnvRc != JNI_OK) {
if (getEnvRc != JNI_EDETACHED) { if (getEnvRc != JNI_EDETACHED) {
LOGE("Callback thread failed to GetEnv for class %s with rc %d.\n", configClassName, getEnvRc); LOGE("saf_open failed to GetEnv for class %s with rc %d.\n", configClassName, getEnvRc);
return 0; return 0;
} }
if ((*globalVm)->AttachCurrentThread(globalVm, &env, NULL) != 0) { if ((*globalVm)->AttachCurrentThread(globalVm, &env, NULL) != 0) {
LOGE("Callback thread failed to AttachCurrentThread for class %s.\n", configClassName); LOGE("saf_open failed to AttachCurrentThread for class %s.\n", configClassName);
return 0; return 0;
} else { } else {
attached = true; attached = true;
@ -602,12 +602,12 @@ int saf_close(int fd) {
jint getEnvRc = (*globalVm)->GetEnv(globalVm, (void**) &env, JNI_VERSION_1_6); jint getEnvRc = (*globalVm)->GetEnv(globalVm, (void**) &env, JNI_VERSION_1_6);
if (getEnvRc != JNI_OK) { if (getEnvRc != JNI_OK) {
if (getEnvRc != JNI_EDETACHED) { if (getEnvRc != JNI_EDETACHED) {
LOGE("Callback thread failed to GetEnv for class %s with rc %d.\n", configClassName, getEnvRc); LOGE("saf_close failed to GetEnv for class %s with rc %d.\n", configClassName, getEnvRc);
return 0; return 0;
} }
if ((*globalVm)->AttachCurrentThread(globalVm, &env, NULL) != 0) { if ((*globalVm)->AttachCurrentThread(globalVm, &env, NULL) != 0) {
LOGE("Callback thread failed to AttachCurrentThread for class %s.\n", configClassName); LOGE("saf_close failed to AttachCurrentThread for class %s.\n", configClassName);
return 0; return 0;
} else { } else {
attached = true; attached = true;

Loading…
Cancel
Save