Skip to content

Commit 9ae3ee7

Browse files
committed
change windowBuffer to local reference
1 parent 43ede7a commit 9ae3ee7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎app/src/main/cpp/video_filter.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ AVFilterGraph *filter_graph;
2424

2525
AVFormatContext *pFormatCtx;
2626
AVCodecContext *pCodecCtx;
27-
ANativeWindow_Buffer windowBuffer;
2827
ANativeWindow *nativeWindow;
2928

3029
int again;
@@ -339,6 +338,7 @@ VIDEO_PLAYER_FUNC(jint, filter, jstring filePath, jobject surface, jint position
339338
ret = av_buffersink_get_frame(buffersink_ctx, filter_frame);
340339
if (ret >= 0) {
341340
// lock native window
341+
ANativeWindow_Buffer windowBuffer;
342342
ANativeWindow_lock(nativeWindow, &windowBuffer, 0);
343343
// convert
344344
sws_scale(sws_ctx, (uint8_t const *const *) filter_frame->data,
@@ -380,8 +380,8 @@ VIDEO_PLAYER_FUNC(jint, filter, jstring filePath, jobject surface, jint position
380380
av_free(filter_frame);
381381
av_free(pFrame);
382382

383-
// free(audio_track);
384-
// free(&windowBuffer);
383+
audio_track = NULL;
384+
audio_track_write_mid = NULL;
385385
ANativeWindow_release(nativeWindow);
386386
(*env)->ReleaseStringUTFChars(env, filePath, file_name);
387387
LOGE(TAG, "do release...");

0 commit comments

Comments
 (0)