From d7a97fa5f20f34c5e7fed3bc945c6e6a7b4ad33e Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Sat, 15 Aug 2020 20:58:45 +0800 Subject: [PATCH] break the loop when has found video index break the loop when has found video index --- app/src/main/cpp/video_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/video_filter.c b/app/src/main/cpp/video_filter.c index 354beb2..b1f2971 100644 --- a/app/src/main/cpp/video_filter.c +++ b/app/src/main/cpp/video_filter.c @@ -165,9 +165,9 @@ int open_input(JNIEnv *env, const char *file_name, jobject surface) { int i; for (i = 0; i < pFormatCtx->nb_streams; i++) { - if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO - && video_stream_index < 0) { + if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { video_stream_index = i; + break; } } if (video_stream_index == -1) {