File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ typedef struct VideoInfo {
4848
4949 ~VideoInfo () {
5050 if (video_dec_ctx) {
51- avcodec_close (video_dec_ctx);
52- video_dec_ctx = nullptr ;
51+ avcodec_free_context (&video_dec_ctx);
5352 }
5453 if (fmt_ctx) {
5554 avformat_close_input (&fmt_ctx);
@@ -919,21 +918,7 @@ extern "C" JNIEXPORT jint JNICALL Java_org_telegram_ui_Components_AnimatedFileDr
919918 // info->has_decoded_frames = false;
920919 while (!info->stopped && triesCount != 0 ) {
921920 if (info->stream != nullptr ) {
922- JNIEnv *jniEnv = nullptr ;
923- JavaVMAttachArgs jvmArgs;
924- jvmArgs.version = JNI_VERSION_1_6 ;
925-
926- bool attached;
927- if (JNI_EDETACHED == javaVm->GetEnv ((void **) &jniEnv, JNI_VERSION_1_6 )) {
928- javaVm->AttachCurrentThread (&jniEnv, &jvmArgs);
929- attached = true ;
930- } else {
931- attached = false ;
932- }
933- jboolean canceled = jniEnv->CallBooleanMethod (info->stream , jclass_AnimatedFileDrawableStream_isCanceled);
934- if (attached) {
935- javaVm->DetachCurrentThread ();
936- }
921+ jboolean canceled = env->CallBooleanMethod (info->stream , jclass_AnimatedFileDrawableStream_isCanceled);
937922 if (canceled) {
938923 return 0 ;
939924 }
You can’t perform that action at this time.
0 commit comments