]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ffjni.c
vorbisenc: Stop tracking number of samples per frame
[ffmpeg] / libavcodec / ffjni.c
index 3f4c3806730df1016f5a666a23e7d9e81ff01cee..f5b581f0f685c0ddb9180c5f952f069667ba9689 100644 (file)
@@ -85,7 +85,7 @@ JNIEnv *ff_jni_get_env(void *log_ctx)
         av_log(log_ctx, AV_LOG_ERROR, "The specified JNI version is not supported\n");
         break;
     default:
-        av_log(log_ctx, AV_LOG_ERROR, "Failed to get the JNI environment attached to this thread");
+        av_log(log_ctx, AV_LOG_ERROR, "Failed to get the JNI environment attached to this thread\n");
         break;
     }
 
@@ -303,6 +303,11 @@ int ff_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfi
 
             last_clazz = *(jclass*)((uint8_t*)jfields + jfields_mapping[i].offset) =
                     global ? (*env)->NewGlobalRef(env, clazz) : clazz;
+
+            if (global) {
+                (*env)->DeleteLocalRef(env, clazz);
+            }
+
         } else {
 
             if (!last_clazz) {